Kubernetes Architecture:

Kubernetes is built on a master-worker architecture. The master node is responsible for managing the overall state of the cluster, while the worker nodes run the actual application workloads. The components of the Kubernetes master node include the API server, etcd, scheduler, and controller manager.The worker nodes run the kubelet, kube-proxy, and the container runtime

The kube-apiserver is the control plane component that serves as the primary management
entity for the cluster. It handles all communication and authentication, and controls all other components of the cluster. Additionally, the kube-apiserver is also responsible for monitoring and controlling the state of the cluster, making sure that all components are running as expected.

Etcd is a distributed key-value database that is used by Kubernetes to store cluster state data. It is responsible for maintaining the configuration details of the Kubernetes cluster and is the only component that interacts directly with the kube-apiserver. etcd provides a reliable and highly available data store for Kubernetes, ensuring that the cluster can recover quickly from failures and maintain consistency across all nodes.

The kube-scheduler is responsible for assigning newly created pods to nodes in the cluster. It reads the list of unassigned pods from etcd and, using a variety of algorithms and configurations, determines which node each pod should run on. Once it has made its decision, the kube-scheduler informs the kube-apiserver, which in turn communicates with the kubelet on the chosen node to start the pod's containers and begin running the workload.

The kube-control-manager is a collection of controllers that manage various aspects of the Kubernetes cluster. These controllers include the node controller, which watches the state of nodes in the cluster and takes actions to ensure that nodes are stable and healthy. For example, if a node fails, the node controller will take actions to ensure that the workloads running on the failed node are rescheduled onto other nodes in the cluster. Other controllers in the kubecontrol-manager include the replication controller, endpoint controller, and service account and token controllers, which manage other aspects of the cluster such as scaling, networking, and security.

The kubelet is the primary node agent that runs on each worker node in the Kubernetes
cluster. It is responsible for managing and monitoring the state of containers running on the node, as well as ensuring that the containers are healthy and running as expected. The kubelet communicates with the kube-apiserver to receive instructions on which pods to run on the node, and reports back to the master node with updates on the status of the containers and their health. Additionally, the kubelet also manages the networking and storage configurations for the containers running on the node
.

The Kube-proxy is responsible for managing the networking and routing configurations
for services within the cluster. In Kubernetes, a service functions as an abstraction layer that facilitates communication between pods in the cluster. When a service is established, Kubernetes generates a set of iptables rules on each node within the cluster. Managed by kube-proxy, these rules enable traffic to be accurately directed to the appropriate pods associated with the service, irrespective of the node they operate on. This ensures that communication between the pods and services is both reliable and efficient.

The container runtime is responsible for running containers on each node in the cluster. The container runtime is a software component that manages the lifecycle of containers, including pulling container images from a registry, creating and starting containers, monitoring their health, and stopping or deleting them when they are no longer needed.

Kubernetes components can be run in a Kubernetes cluster as containers or system-level services, depending on their requirements and the needs of the cluster. In general, Kubernetes components that require access to system resources or need to run on the node itself (such as the kubelet and kube-proxy) are run as system-level services on each node. Components that do not require direct access to system resogurces and can be run in a container (such as the API server, etcd, kube-scheduler, and kube-controller-manager) are typically deployed as containers in pods.

Leave a Comment