What is Kubernetes?
Kubernetes (often shortened to “K8s”) is an open-source container orchestration system for automating 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 way to deploy, manage and scale containerized applications in a cluster of machines. It abstracts away the complexity of managing individual machines and allows developers to focus on their applications.
The basic building blocks of a Kubernetes cluster are:
- Nodes: The machines (virtual or physical) that run the containerized applications.
- Pods: The smallest and simplest unit in the Kubernetes object model, it’s a logical host for one or more containers.
- Replication Controllers: ensure that a specified number of replicas of a pod are running at any given time
- Services: provide a stable endpoint for pods, enabling load balancing and service discovery.
- Deployments: provide declarative updates for Pods and Replication Controllers.
- ConfigMaps and Secrets: provide a way to manage configuration and secrets separately from the pods.
- Control Plane manages the worker nodes and the Pods in the cluster. In production environments, the control plane usually runs across multiple computers and a cluster usually runs multiple nodes, providing fault tolerance and high availability.
- Kubelet: A Kubernetes cluster also runs a process called Kubelet on each node. It is responsible for maintaining the desired state of the pods on the node, which includes starting and stopping containers as necessary.
- Kube-proxy: It is another process that runs on each node in a Kubernetes cluster. It is responsible for maintaining network connectivity for pods by forwarding network traffic to the appropriate pod based on IP and port. It also enables services to load-balance network traffic to pods.
Kubernetes uses a declarative approach for deploying and managing containerized applications, through the use of YAML or JSON files to define the desired state of the cluster, and the system will automatically make the necessary changes to the current state to match the desired state.
Kubernetes provides a number of features for managing and scaling containerized applications, including automatic self-healing, automatic scaling, service discovery, and load balancing. It also provides a number of built-in tools for monitoring, logging, and troubleshooting, making it easier to run and manage containerized applications at scale.