Kubernetes Introduction

Define Kubernetes

Kubernetes is an open-source container orchestration system that automates the deployment, scaling, and management of containerized applications. It was originally developed by Google and is now maintained by the Cloud Native Computing Foundation (CNCF). Kubernetes provides a framework for automating the deployment and scaling of containerized applications, along with tools for managing and monitoring these applications in a clustered environment.

Difference between Control Plan and Data Plan

In Kubernetes, the control plane and data plane are two key components that work together to manage and operate containerized applications.

Control Plane: The control plane is the central management entity in Kubernetes responsible for making global decisions about the cluster (e.g., scheduling), as well as detecting and responding to cluster events (e.g., starting up a new pod when a deployment's replicas field is unsatisfied)

Components:

  • API Server: Exposes the Kubernetes API, which is used to interact with the control plane.

  • Controller Manager: Monitors the cluster state and responds to changes, such as starting up new pods or adjusting the number of replicas.

  • Scheduler: Assigns pods to nodes based on resource requirements and constraints.

  • etcd: Consistent and highly available key-value store used as the cluster's main database.

Data Plane:

The data plane, also known as the node or worker node, is responsible for running the containers and managing the networking between them.

Components:

  • Kubelet: Ensures that containers are running on a node, receives Pod definitions, and starts or stops containers as necessary.

  • Container Runtime: The software responsible for running containers, such as Docker or containerd.

  • Kube Proxy: Maintains network rules on nodes. It handles network communication to/from the pods.

In summary, the control plane is the brain of the Kubernetes cluster, making decisions and managing the overall state, while the data plane is responsible for the actual execution of those decisions, running containers, and handling networking. The interaction between the control plane and data plane ensures that the desired state of the applications (specified by users through manifests) is realized and maintained within the cluster.

Kubernetes Architecture

What happens if the node goes down?

So, the controller manager comes into play and it is going to submit for a new pod to be created and scheduled, and it's the responsibility of the scheduler to find a node to put that pod on.

Write the difference between kubectl and kubelets.

  • kubectl (Kubernetes Control CLI): kubectl is a command-line tool used by administrators and developers to interact with the Kubernetes cluster. It allows users to manage and control the cluster by issuing commands for deploying, scaling, inspecting, and troubleshooting applications and resources within the cluster. kubectl communicates with the Kubernetes API server to perform these actions.

  • kubelet (Kubernetes Node Agent): kubelet is an agent that runs on each worker node in the Kubernetes cluster. Its primary responsibility is to ensure that containers (pods) are running on the node as expected. kubelet communicates with the Control Plane (API server) to receive pod specifications and then manages the containers on the node to match the desired state.