DEV Community

Deepak Sabhrawal
Deepak Sabhrawal

Posted on • Updated on

Kubernetes - Basics

Features:

  1. Container management - Can manage docker containers and other vendor containers as well so it is container-native orchestration tool.
  2. HA - Create a container on a healthy node if any container goes down.
  3. Scaling & Load Balancing - Scale containers based on load and other various parameters, hence balancing the load.
  4. Rolling Update - Update containers without impacting and support many other update strategies.
  5. Rollback - Rollback updates if something went wrong without impact.

Architecture:

K8s Cluster has two main nodes:

  1. Master node (Control Plane): Manages nodes and whole cluster.
  2. K8S Nodes/ Minions (Worker Nodes): Actual worker nodes where Pods are scheduled to run containers.

Cluster Components:

  1. API-Server- Api server facilitates the communication with Kubernetes cluster through the Kubectl command. We provide the manifest yaml file through Kubectl and API-server works accordingly. It interacts with scheduler, Controller, and Key-value store (etcd).
  2. Controller- Manages the health of the cluster and controls everything. Suppose 100 nodes are defined in the manifest file then the controller keeps track to ensure that 100 nodes are running.
  3. Scheduler- Schedules the nodes/pods in the cluster according to the manifest file.
  4. Key-value store (etcd) - This is the true source of information and store nodes information in the form of Key-value. Any node information can be fetched from this store.
  5. Kublet- Kublet is like a manager on a minion node. API-Server interacts with Kublet to deploy the containers. The Kublet interacts with the controller and reports everything about the minion node. All the decisions are then taken by the controller.
  6. Pod- Pod is the wrapping around the container. A pod is a basic unit in a Kubernetes cluster. We do not deploy a Container, always a Pod is deployed and Container runs inside Pod. A pod can have multiple Containers but in general, a single Pod contains a single Container as a best practice. Pod is assigned an IP that is shared among Containers running inside Pod. A pod is also the scaling unit in Kubernetes.
  7. Kube-Proxy- Kube-Proxy acts like a network brain of the cluster and manages the network communication within the cluster.
  8. Runtime- Every node has its own runtime that might differ from other nodes. The most commonly used runtime is docker. This runtime is used to run the containers.

Interaction with a K8s Cluster:

  1. API: Everything happens through API requests.
  2. Native Libraries: If you are a developer and have a used case to manage the cluster using a coding language then you have native libraries to interact with the cluster.
  3. Kube controler (kubectl): This is the main and most used way to connect with a k8s cluster and get the job done.

Top comments (0)