Kubernetes Overview
With the widespread adoption of containers among organizations, Kubernetes, the container-centric management software, has become a standard for deploying and operating containerized applications and is one of the most important parts of DevOps.
Originally developed at Google and released as open-source in 2014. Kubernetes builds on 15 years of running Google's containerized workloads and the valuable contributions from the open-source community. Inspired by Googleβs internal cluster management system, Borg.
What is Kubernetes?
Kubernetes, often abbreviated as k8s, is an open-source container orchestration platform used for automating the deployment, scaling and management of containerized applications. It was originally developed by Google and is now managed by the Cloud Native Computing Foundation (CNCF). Kubernetes provides a robust framework for container management, making it easier to deploy and manage applications at scale.
Key Features
Kubernetes manages the deployment, scaling and scaling down of containers, ensuring that the applications run smoothly and efficiently.
It can automatically distribute network traffic to the healthy containers, improving application availability.
Kubernetes can detect and replace failed containers or nodes, minimizing downtime.
It allows easy scaling of applications, both vertically (adding more resources to a container) and horizontally (replicating containers).
Kubernetes provide mechanisms for containers to communicate with each other using services and DNS.
It enables controlled updates and rollbacks of applications.
It allows you to specify the resource requirements for containers.
Why do we call it k8s?
The short form 'K8s' for Kubernetes is derived from its full name. It's just a way to shorten the name of Kubernetes.
'K' represents the first letter of Kube.
'8' is the number of letters between the 'K' and 's' in the word 'Kubernetes'.
's' represents the last letter of 'Kubernetes'.
This abbreviation is commonly used in discussions, documentation, and conversations about Kubernetes to make it more concise and easier to type or say.
Benefits of using K8s
Kubernetes offers many benefits for container orchestration and managing containerized applications. Here are some advantages of K8s:
Kubernetes allows you to easily scale your application up or down based on demand.
Kubernetes ensures that your application is highly available by automatically rescheduling and replacing the failed containers.
K8s provides a standardised way to package and deploy applications using containers.
It optimizes resource allocation and minimizes wastage.
K8s can detect and replace failed containers or nodes, ensuring that the application remains available and healthy.
You can easily perform updates to your applications without downtime using rolling updates.
Architecture of Kubernetes
Master Node
API server: It's the central control plane component that exposes the k8s API and is responsible for handling requests from users, the CLI and other components.
etcd: It stores all cluster data, including configuration details and the current state of the cluster
Controller Manager: It watches the cluster's state stored in etcd and ensures that the actual state matches the desired state by creating, updating and deleting the resources as needed.
Scheduler: Assign work to nodes based on resource requirements and make sure workloads are balanced and highly available.
Worker Node
Kubelet: The primary agent running on each node that communicates with the API server.
Container Runtime: The software responsible for running containers.
Kube Proxy: Maintains network rules on nodes and communicates with outside users.
Pods: The smallest deployable units in k8s, represent one or more containers that share the same network namespace and storage volume.
What is a Control Plane?
The Control Plane, often referred to as the "master" or "management" plane, is a key component of the Kubernetes (K8s) architecture responsible for managing and controlling the cluster's state and configuration. It acts as the central coordination and decision-making entity in a K8s cluster. The Control Plane components work together to ensure the desired state of the cluster matches the actual state by reconciling any differences.
Difference between the Kubectl and Kubelet
Kubectl (K8s control CLI)
kubectl is a command-line tool used by administrators and developers to interact with the Kubernetes cluster.
It is used to perform various tasks such as deploying, scaling, updating and monitoring applications running in a cluster.
It requires access to the Kubernetes API server.
Kubelet (k8s Node Agent)
kubelet is an agent that runs on each worker node in a Kubernetes cluster.
kubelet manages the containers and their lifecycle on a node, including starting, stopping, and monitoring container processes.
kubelet is responsible for managing containers locally on a node and it doesn't interact with the Kubernetes API server directly.
Role of API Server
The API Server is a critical component in a Kubernetes cluster, serving as the central management point and the primary entry point for interacting with the cluster. Here are the roles of the API server:
The API Server authenticates users and verifies their permissions before allowing any interaction with the cluster.
he API Server exposes a RESTful HTTP API that acts as an endpoint for managing various Kubernetes resources (e.g., Pods, Services, Deployments).
When resources are created or updated, the API server ensures that the resource specifications are valid for the k8s schema and resource constraints.
The API Server supports admission control plugins, which enable custom admission logic to be applied before resources are persisted in the cluster.
The API Server is responsible for storing the desired state of the cluster in the etcd data store.
<That's all for today. Hope you like it. FOLLOW to join me in the journey of DevOps>