Kubernetes (k8s) architecture
Kubernetes (k8s) architecture is designed to provide a robust, scalable, and portable way to manage containerized workloads and services. It includes several key components, each with a specific role in managing the lifecycle of applications. Here is an overview of the Kubernetes architecture:
High-Level Architecture
- Control Plane: Manages the overall state of the cluster.
- Node (Worker Node): Runs containerized applications.
Components of the Control Plane
-
API Server (
kube-apiserver
):- Serves the Kubernetes API, which is the entry point for all administrative tasks.
- Acts as the front-end of the Kubernetes control plane.
- Validates and configures data for API objects, including pods, services, and controllers.
- All components interact with the API server to maintain the desired state of the cluster.
-
etcd:
- A consistent and highly-available key-value store used as Kubernetes' backing store for all cluster data.
- Stores configuration data, state data, and metadata about the cluster.
- Supports leader election and ensures the high availability of the cluster's data.
-
Controller Manager (
kube-controller-manager
):- Runs controller processes that handle routine tasks to regulate the state of the cluster.
- Includes several controllers, such as Node Controller, Replication Controller, Endpoints Controller, and Service Account & Token Controllers.
- Ensures that the desired state matches the current state by responding to changes.
-
Scheduler (
kube-scheduler
):- Assigns nodes to newly created pods based on resource availability and other scheduling policies.
- Monitors resource usage and allocates work to appropriate nodes.
-
Cloud Controller Manager:
- Integrates with underlying cloud providers to manage cloud-specific resources.
- Handles cloud provider-specific control loops, such as managing load balancers and persistent storage.
Components of the Worker Node
-
Kubelet:
- An agent that runs on each worker node.
- Ensures containers are running in a Pod by interacting with the container runtime (like Docker or containerd).
- Registers the node with the Kubernetes cluster and communicates with the API server.
-
Kube-proxy:
- A network proxy that runs on each worker node.
- Manages networking rules to allow communication to and from Pods.
- Implements service networking, ensuring that services are accessible within the cluster.
-
Container Runtime:
- Responsible for running containerized applications.
- Common container runtimes include Docker, containerd, and CRI-O.
-
Pods:
- The smallest and simplest Kubernetes object.
- Encapsulates one or more containers that share storage, network, and a specification for how to run the containers.
Kubernetes Node Components
Each node in a Kubernetes cluster contains the services necessary to run Pods and is managed by the control plane. The components on a node include:
- Container Runtime: Runs the containers (e.g., Docker, containerd).
- Kubelet: Ensures containers are running in Pods on the node.
- Kube-proxy: Manages network rules on the node.
Published on: Jul 03, 2024, 06:28 AM
Updated on: Jul 03, 2024, 06:29 AM