6. etcd
write:
$ etcdctl set /message Hello
or
$ curl -L -X PUT http://127.0.0.1:4001/v2/keys/message -d value="Hello"
read:
$ etcdctl get /message
or
$ curl -L http://127.0.0.1:4001/v2/keys/message
20151021 cc by-nc 3.0 6
7. fleet
Manage nodes, pods, services via fleetctl
COMMANDS:
cat Output the contents of a submitted unit
destroy Destroy one or more units in the cluster
fd-forward Proxy stdin and stdout to a unix domain socket
help Show a list of commands or help for one command
journal Print the journal of a unit in the cluster to stdout
list-machines Enumerate the current hosts in the cluster
list-unit-files List the units that exist in the cluster.
list-units List the current state of units in the cluster
load Schedule one or more units in the cluster, first submitting them if necessary.
ssh Open interactive shell on a machine in the cluster
start Instruct systemd to start one or more units in the cluster, first submitting and loading if necessary.
status Output the status of one or more units in the cluster
stop Instruct systemd to stop one or more units in the cluster.
submit Upload one or more units to the cluster without starting them
unload Unschedule one or more units in the cluster.
verify DEPRECATED - No longer works
version Print the version and exit
20151021 cc by-nc 3.0 7
9. Why?
Challenges:
• Commodity hardware not reliable
• App execution environment moves around
• Different developing and deployment software stacks, and many best
practices
• Varies events occur at wide geographic area that effects our context, the
information are different type, changes very fast, large amount
Containers, Cluster OS and management system can help us to deal with the
problems.
920151021 cc by-nc 3.0
11. Kubernetes
• Is a platform for hosting containers in a clustered environment
with multiple hosts
• Provides container grouping, load balancing, auto scaling, and
self-healing
• Started by Google,
[google white paper]:http://static.googleusercontent.com/media/research.google.com/en//pubs/archive/43438.pdf
20151021 cc by-nc 3.0 11
12. 1220151021 cc by-nc 3.0
http://blog.arungupta.me/wp-content/uploads/2015/01/kubernetes-architecture.png
Kubernetes Architecture
14. Main Components
Master
• maintains state of kubernetes server
with etcd.
• is the entry point of Kubernetes
client to configure and manage
Nodes, Pods, Replicators, Services.
• reconcile the difference between
the current state and desired state.
Worker Node
• run a command from master node
• report current node state
20151021 cc by-nc 3.0 14
15. Master
Replication Controller
• Uses Pod Templates to create Pods
• Uses Label to monitor and maintain
the desired Pods level at any one
time
Service Registry
• Is a wrapper on top of etcd persistent
storage, which keep track of services
• can be performed on registry: create
service, update, delete, ...
API Server
• Scheduler
• Authentication
Distributed Watchable Storage
• States of Kubernetes
• Configuration
• Watch changes
20151021 cc by-nc 3.0 15
16. Work Node
Service
• An abstraction layer defined a logic
set of Pods and access policy to
deliver the functions.
• Selector gets a set of Pods per their
Labels.
• Elements of service: Name, Port of
Proxy, Selector, Uses load balance
Pod
• Label
• Share Volume
• visible IP
• single or multiple containers
• template
20151021 cc by-nc 3.0 16
17. Kubectl
• run on each node, manage life cycle of
Pods
• 1:1 map to host
• communicate among themselves to keep
information up to date, data is stored in a
distributed, watchable storage
• main elements:
– cAdviser: monitor and display Pods
status
– etcd client: interface with central
storage
– docker client: for create, start, stop,
delete container
Functions:
• run a action on a Pod
• bind a Volume to container
• bind ports to containers
• provide container health information
• interface with host
20151021 cc by-nc 3.0 17
From [using the client]:https://github.com/coreos/fleet/blob/master/Documentation/using-the-client.md
Commodity hardware we used for constructing data center and cloud is not very reliable => we need a way to over come it.
App execution environment moves around => we need to bring your environment.
Different developing and deployment software stacks and practices => keep everyone happy and productive.
Varies events occur at wide geographic area that effects our context, the information are different type, changes very fast, large amount => we need understand what happened, how do they effect our apps.