Kubernetes Architecture

Parth SharmaParth Sharma
3 min read

Kubernetes is a powerful, open-source container orchestration platform developed by Google for automating the deployment, scaling, and operation of application containers. Below is a detailed overview of its architecture, covering its major components and their interactions.

Key Components of Kubernetes Architecture

Kubernetes architecture can be divided into two primary layers: the Control Plane and the Worker Nodes.

1. Control Plane: The Control Plane is the brain of the Kubernetes cluster. It manages the state of the cluster, including detecting and responding to events that happen in the cluster.

  • kube-apiserver: This is the API server of the Control Plane. It exposes the Kubernetes API and serves as the central management entity that communicates with all components of the Kubernetes cluster. All REST commands for managing the cluster are sent to this component.

  • etcd: A distributed key-value store used for storing all cluster data. It keeps track of the state of the cluster and serves as the source of truth. All configurations, the desired state of the cluster, and metadata are stored in etcd.

  • kube-scheduler: The scheduler watches for newly created Pods that have no Node assigned and selects a Node for them to run on. It considers available resources, QoS requirements, and other factors to make scheduling decisions.

  • kube-controller-manager: This component runs controller processes that watch the state of the cluster, and, if they find that the current state does not match the desired state, takes action to reconcile the two. Controllers include replication controller, endpoints controller, and others.

  • Cloud Controller Manager (optional): If Kubernetes is running on a cloud provider, this component manages the interaction with that provider. It allows for cloud-specific features such as load balancers, storage volumes, etc.

2. Worker Nodes: Worker Nodes are the machines that run your application workloads. They host the Pods, which are the smallest deployable units in Kubernetes.

- kubelet: An agent that runs on each node in the Kubernetes cluster. It is responsible for ensuring that containers are running in a Pod. The kubelet watches for Pods assigned to its Node and reports statuses back to the Control Plane.

  • kube-proxy: This component manages network rules and routing for access to the Pods. It enables network communication between different parts of the cluster and helps route traffic to the correct Pods, providing service discovery.

  • Container Runtime: The software responsible for running the containers. Kubernetes supports multiple container runtimes, including Docker, containerd, and CRI-O. The container runtime pulls the container images and manages their lifecycle (creating, starting, stopping, and deleting containers).

  • Pods: The basic operational unit in Kubernetes that encapsulates one or more containers, storage resources, a unique network IP, and options that govern how the containers should run together. Pods provide a way to co-locate and operate tightly coupled application components.

Additional Concepts

Services: A Kubernetes service is a stable endpoint that defines a logical set of Pods and enables network access to them. Services allow different Pods to discover and communicate with each other, abstracting away the underlying IP addresses of Pods which can change.

Namespaces: Namespaces are a way to divide cluster resources between multiple users or teams. Namespaces provide a mechanism for isolating groups of resources within a single cluster.

Deployments: A Deployment provides declarative updates for Pods and ReplicaSets. It ensures that the specified number of replicas of a Pod are running and can help automate the rollout of new application versions.

Conclusion: In summary, the Kubernetes architecture is a rich and complex handling of multiple components that work together to assure effective orchestration of containerized applications. Its modular design allows for flexibility and support for diverse workloads, whether they're running on-premises or in the cloud. Kubernetes abstracts away many of the underlying complexities of container management, enabling developers to focus on deploying applications rather than managing the details of how those applications run.

"I believe this article will be beneficial, allowing you to uncover fresh insights and gain enriching knowledge."

Happy Learning๐Ÿ™‚

PARTH SHARMA

0
Subscribe to my newsletter

Read articles from Parth Sharma directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Parth Sharma
Parth Sharma