Kubernetes Architecture and Concepts
Kubernetes mainly consists of :
Master node(Control plane nodes(api-server, kube-scheduler, controller-manager, etcd)
Worker Node(Kubelet + kube-proxy)
Components of Master Node:
- kube-apiserver: This component is responsible for exposing all the APIs by Kubernetes cluster. All components from Master / Worker nodes can communicate with api-server directly, hence acting as an interface b/w master & worker node. Clients authenticate via the API Server and also use it as a proxy/tunnel to nodes and pods (and services). The kube-apiserver is responsible for API validation before the resources are actually generated and saved to the data store. Clients can communicate with the API server either through the kubectl command-line client or through a REST API call.
- etcd: etcd is a distributed, highly-available key-value data store. It stores all the information about Pods, Nodes, services, desired / current state for all resources. Kube-apiserver is the only component to which etcd talks to. Any user/client, needing access to etcd can only be done via APIs exposed by api-server.
- kube-controller-manager: Kubernetes manages applications through various controllers. They basically are control loops that operate on the concept of comparing the current status against the desired state. They watch the current cluster state stored in etcd through the kube-apiserver and create, update, and delete resources as necessary. Various kube-controller-manager are : - Node Controller - Deployment Controller - DaemonSet - Replica Set - Replica Controller
- kube-scheduler: Scheduler is responsible for placing pods on Nodes. A scheduler watches for newly created Pods that have no Node assigned. For every Pod that the scheduler discovers, the scheduler becomes responsible for finding the best Node for that Pod to run on. It consider various factors like - The requirement for pods. - Resource availability at Nodes. - Taints / Toleration , Node Affinity, Node Selectors.
Components of Worker Node:
- kubelet: A Kubelet tracks the state of a pod to ensure that all the containers are running. It provides a heartbeat message every few seconds to the master server. If a replication controller does not receive that message, the node is marked as unhealthy.
- kube-proxy: The Kube proxy routes traffic coming into a node from the service. It forwards requests for work to the correct containers. The kube-proxy component is a network proxy that runs on each node.
Comments
Post a Comment