What is it ?
Kubernetes is a container orchestration platform developed by initially released by Google but now maintained by the Cloud Native Computing Foundation (CNCF).
High Level Features
Some of the basic Kubernetes features are listed below.
- Automate container scaling
- Self-heal containers
- Automatic rollback and rollout
- Storage orchestration
- Container load balancing
Kubernetes Architecture
On starting a kubernetes deployment we get a cluster, we can divide a Kubernetes cluster into 3 different components:
- Master nodes
- Worker nodes
- Distributed key-value store (etcd)
Master Node
The Master Node manages the whole Kubernetes cluster acting as the main control point for the cluster state and management. For high availability, there can be multiple master nodes, but for administrative tasks, only one will act as a leader.
Each master node will have:
- Controller - manage the cluster and make sure current state is matched with the desired state of an application
- API Server — all administrative tasks for the cluster is done through this API server. All CLI, API and dashboard commands are directed to this API server where it will validate the request and execute them
- Scheduler — schedules the work for different worker nodes. Scheduler knows about the currently running applications on each node and knows about the constraints on each worker node. Based on this information, the scheduler assigns the worker node for a deployment/service.
Worker Node
A worker node is any machine within the cluster that runs pods with containers. All the worker nodes are controlled by the master node. To access the application we need to connect to the worker nodes
Each worker node contains:
- kube-proxy — network proxy which runs on each worker node and listens to the API server for each endpoint creation or deletion. Kube-proxy creates routes for each endpoint hence kube-proxy is the component that enables communication to worker nodes from within the cluster or from outside.
- kubelet — agent which runs on every worker node which communicates with the master node. It has the responsibility of executing pod execution commands and make sure that pods are always healthy.
- Container Runtime — manage the container lifecycle on the worker node. Kubernetes supports many container runtimes such as Docker, containerd etc..