Kubernetes clusters consist of nodes
The cluster is maintained by the control plane
Applications are executed on worker nodes
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
kind-control-plane Ready master 78s v1.18.2
kind-worker Ready <none> 41s v1.18.2
Worker nodes execute containerized services
kubelet
manages pod descriptions and controls the container runtime
The container runtime manages the individual containers
kube-proxy
is responsible for network communication with services
$ docker exec -it kind-worker ps fxwwo pid,cmd
PID CMD
123 /usr/local/bin/containerd
430 /usr/bin/kubelet
479 /usr/local/bin/containerd-shim-runc-v2
528 \_ /pause
598 \_ /bin/kindnetd
504 /usr/local/bin/containerd-shim-runc-v2
535 \_ /pause
607 \_ /usr/local/bin/kube-proxy
Control plane nodes manage the cluster
api-server
provides the Kubernetes API
All cluster data is stored in etcd
etcd
is a key-value store
kube-scheduler
assigns pods to workers
kube-controller-manager
runs controllers that adapt the cluster state to the resources
$ docker exec -it kind-control-plane ps fxwwo pid,cmd
PID CMD
129 /usr/local/bin/containerd
353 /usr/local/bin/containerd-shim-runc-v2
472 \_ /pause
660 \_ etcd
357 /usr/local/bin/containerd-shim-runc-v2
474 \_ /pause
564 \_ kube-scheduler
363 /usr/local/bin/containerd-shim-runc-v2
459 \_ /pause
571 \_ kube-controller-manager
389 /usr/local/bin/containerd-shim-runc-v2
458 \_ /pause
620 \_ kube-apiserver
Controller are responsible for a specific resource type
Controllers are implemented as a infinite loop…
…that checks the current state…
…and tries to reach the desired state
Kubernetes ships with many builtin resource types, e.g. Pod, Service, Deployment
kube-controller-manager
contains all builtin controllers
Pod
is createdkube-controller-manager
reacts to the eventAll services on the worker nodes communicate with the api-server
kubelet
handles all communication for the worker node
Clusters can be scaled in different ways
Type | Controllers | Workers |
---|---|---|
Single node | 0,5 | 0,5 |
Multiple workers | 1 | 1+ |
Highly available | 3+ (uneven) | 1+ |
etcd
can run as a container in the cluster
etcd
can be consumed as an external service