My Novice Learning into Kubernetes - Part 1

Hendrik Agung
Hendrik Agung

Write this post as a note to my beginner learning with Kubernetes, this part is a note about the basic architecture of Kubernetes.

Kubernetes Cluster Architecture

Kubernetes cluster is composed of many nodes, which can divided into two types:

  • Master node, which hosts Kubernetes Control Plane and is responsible for controlling and managing the entire Kubernetes system
  • Worker node, this node runs the actual applications that we deploy within the cluster

In Kubernetes, a node is a single machine within the cluster. This machine can be either a physical machine or a virtual machine (VM).

The Control Plane

Control Plane consists of multiple components that can run in a single master node or be split across multiple nodes and replicated to ensure high availability.

Kubernetes API Server, the brain behind all operations in Kubernetes Whenever a request is sent to the API server by a user, the API server performs three tasks:

  • Authentication: Authenticates the user.
  • Authorization: Authorizes the request made by the authenticated user using Role-Based Access Control (RBAC).
  • Admission Control: Applies specific rules and policies on Pods to determine
    whether they are allowed to run.

Scheduler is responsible for assigning pods to nodes. When the API server receives a request to run a pod, it forwards the request to the scheduler. The scheduler then determines the best worker node to run the pod.

Controller manager, a component of the Kubernetes control plane that regulates the state of the cluster by running controllers or operators. These controllers are watch-loop processes that continuously compare the cluster's desired state with its actual state.

Etcd is responsible for storing all cluster-related information, including job scheduling details, Pod information, and state data among others. It ensures that the cluster's actual state matches the desired state and maintains data consistency through its Raft consensus-based architecture.

The Worker

A worker node provides the environment to run containerized applications. The key components within a worker node are:

Container runtime is responsible for managing the execution and lifecycle of containers within the Kubernetes environment. Kubernetes supports several container runtimes, which are mentioned below:

  • CRI-O
  • contained
  • Docker
  • Mirantis Container Runtime

Kubelet is responsible to manages everything running on a worker node. It registers the node with the API server and continuously checks for new Pods to run. It starts containers using the specified container runtime (like Docker) and monitors them, reporting their status and resource usage to the API server. The Kubelet also runs health checks on containers, restarts them if they fail, and stops them when their Pod is deleted.

Kube-proxy manages networking rules in a Kubernetes cluster, ensuring that clients can connect to the services defined through the Kubernetes API. It ensures that connections to a service's IP and port are routed to one of the pods backing that service or other non-pod service endpoints. When a service is supported by multiple pods, kube-proxy performs load balancing across those pods.

Thank you,

References

Hendrik Agung

Hi, I am Hendrik, an IT security. You can find me at my favorite coffee shop, sipping on a frothy cappuccino (or Americano sometimes) while thinking of new ways to break (I mean protect) your systems!