Understanding Kubernetes - Part 1.
Containerized application management has seen Kubernetes emerge as a top orchestration technology in the realm of contemporary software development and deployment. Deploying, scaling, and administering containerized apps is made easier by it, and it offers a strong framework for automating different parts of application administration.
What is Kubernetes?
Originally created by Google, Kubernetes—often abbreviated as K8s—is an open-source container orchestration technology. It streamlines and automates containerized application deployment, scaling, and management. Its main goal is to provide a uniform environment for application deployment and management across different contexts, ranging from small development setups to massive production clusters, by abstracting the underlying infrastructure.
The control plane and data plane are two crucial parts of Kubernetes that cooperate to coordinate and manage containerized applications.
Control Plane: The control plane is the brain of Kubernetes, responsible for managing the cluster, maintaining the desired state of the system, and making decisions about scheduling, scaling, and maintaining applications. It consists of several key components:
Key Concepts in Kubernetes:
- API Server: The entire Kubernetes cluster is managed centrally via the API Server. It provides the Kubernetes API and serves as the front end for the control plane of Kubernetes.
In addition to updating the appropriate objects in etcd, the Kubernetes API server verifies and configures data for the API objects, which include pods, services, replication controllers, and others. - Kube-scheduler: actively searches for pods that have not yet been assigned to nodes and then assigns them accordingly. When making scheduling decisions, it considers multiple aspects such as the specific and overall resource needs, limitations related to hardware, software, and policies, specifications regarding affinity and anti-affinity, as well as data locality. The kube-scheduler employs a collection of algorithms to execute these scheduling processes.
- Kube-controller-manager: oversees the primary control processes within Kubernetes. It keeps track of the desired cluster state using the Kubernetes API server and implements any required adjustments to align the current state with the desired one. Additionally, it manages various continuous core control processes referred to as "controllers."
- ETCD: serves as a distributed and consistent key-value store utilized for tasks like configuration management, service discovery, and facilitating distributed work coordination. In the context of Kubernetes, ETCD serves as a dependable repository for storing the configuration data of the Kubernetes cluster. This includes maintaining the cluster's status, such as the existing nodes, running pods, their assigned nodes, and other pertinent cluster state information at any given moment.
Pods: The basic unit of deployment in Kubernetes, representing one or more containers that share networking and storage resources.
Deployments: Manage the deployment of replicated applications, ensuring the desired state of a specific number of pods is maintained.
Services: Enable communication between different sets of pods, abstracting away individual IP addresses and providing a stable endpoint for accessing applications.
Persistent Volumes: Provide storage resources that exist beyond the lifecycle of a pod, allowing data to persist even if the pod is deleted.
(https://kubernetes.io/, 2024)
There exists a multitude of methods and technologies available for deploying Kubernetes clusters. These options range from leveraging cloud service providers like Google, Microsoft, AWS, and various others to set up clusters in their respective environments. For learning and development objectives, alternative tools such as Minikube or KinD, among several others, offer the capability to create development clusters directly on your local workstation. These tools simulate Kubernetes environments, providing a platform for experimentation, testing, and learning without the necessity of a full-scale cloud infrastructure.
Creating a Development Cluster using kind
What is kind?
Kubernetes IN Docker (kind) is a tool that allows users to create Kubernetes clusters using Docker containers as nodes. It is particularly useful for testing and development purposes, providing a lightweight and easy-to-set-up environment to simulate a Kubernetes cluster.
Creating a Kubernetes Cluster Imperatively using kind

(https://kind.sigs.k8s.io/, 2024)
- Installation: Ensure Docker is installed on your machine.
- Install kind: Download and install kind according to the instructions for your operating system.
- Create a Cluster: Use the
kind create clustercommand to create a Kubernetes cluster. This command generates a configuration file and starts the cluster.
kind create cluster --name my-cluster- Verify the Cluster: Use
kubectl(Kubernetes command-line tool) to verify the cluster's status.
kubectl cluster-info --context kind-my-clusterCreating a Kubernetes Cluster Declaratively using kind
Instead of creating a cluster imperatively through commands, Kubernetes configurations can be used to define the cluster in a YAML file.
- Create a Cluster Configuration File: Define the cluster's configuration in a YAML file (e.g.,
cluster-config.yaml).
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker- Create the Cluster using Configuration File: Use the
kind create clustercommand with the--configflag to create the cluster based on the configuration file.
kind create cluster --name my-cluster --config cluster-config.yaml- Verify the Cluster: Use
kubectlto ensure the cluster is created successfully.
kubectl cluster-info --context kind-my-clusterConclusion
Developers can now more easily orchestrate and manage containerized apps with Kubernetes, which offers a scalable and effective platform. Developers can create development-only Kubernetes clusters with tools such as kind, which let them test and simulate apps locally before putting them into production. Comprehending the principles of Kubernetes enables developers to properly utilize its capabilities, whether constructing clusters declaratively or imperatively. This simplifies the development and implementation of contemporary applications.