Kubernetes, often abbreviated as K8s, emerged as an open-source container scheduler from Google, drawing on insights gained from developing and managing Borg and Omega. It offers a loosely connected set of components, focusing on application deployment, maintenance, and scalability.
Table of Contents
What is Kubernetes?
Kubernetes serves as the Linux kernel for distributed systems. It abstracts the underlying node hardware and presents a consistent interface for application deployment and resource utilization.
Kubernetes Structure
At its core, Kubernetes exhibits a hierarchical structure that efficiently orchestrates containerized applications. This structure comprises master nodes and worker nodes, collectively forming a robust foundation for managing distributed systems. The master nodes serve as the central brain of the cluster, overseeing critical functions such as workload distribution, scheduling, and overall system health. On the other hand, the worker nodes, often referred to as the cluster’s workforce, execute tasks assigned by the master nodes, ensuring the seamless operation of applications and services. This well-defined structure enables Kubernetes to abstract complexities, provide scalability, and maintain the desired state of the cluster’s components.
Kubernetes Masters
These serve as the central control plane for Kubernetes. They manage essential tasks like the API Server, scheduler, and cluster controller. They also handle cluster state storage, cloud-specific elements, and other vital services.
Kubernetes Nodes
These act as the ‘workers’ in a Kubernetes cluster. Each node runs a lightweight agent that oversees the node itself and executes assigned workloads as directed by the master.
Key Master Components in Kubernetes:
Several key components play pivotal roles within the Kubernetes master nodes, collectively orchestrating the cluster’s operations.
- Kube-apiserver: This component offers a REST interface to access the Kubernetes control plane and data store. All interactions, whether from nodes, users, or applications, are mediated through the API Server. It functions as the cluster’s core, managing authentication, authorization, request handling, mutation, and admission control and serving as the front end to the data store.
- Etcd: Etcd serves as the cluster’s data store, providing a reliable, coherent, and highly accessible key-value repository for preserving the cluster’s state.
- Kube-controller-manager: As the central daemon, the controller-manager oversees core component control loops. It observes the cluster’s state via the API server and guides the cluster towards its desired state.
- Kube-scheduler: The scheduler, a comprehensive and policy-rich engine, evaluates workload specifications and endeavours to allocate them to appropriate resources. These requirements encompass various factors such as hardware prerequisites, affinity, anti-affinity, and custom resource needs.
Key Node Components in Kubernetes:
Within the realm of Kubernetes worker nodes, essential components collaborate to execute workloads seamlessly.
Kubelet
Operating as the node agent, the kubelet manages the lifecycle of pods on its host. It understands YAML container manifests sourced from various origins:
- File path
- HTTP Endpoint
- Etcd watch, responding to changes
- HTTP Server mode, which accepts container manifests via a simple API.
Kube-proxy
This component handles network rules within each node and facilitates connection forwarding or load balancing for Kubernetes cluster services. It offers different proxy modes:
- Userspace
- iptables
- ipvs (alpha in 1.8)