Kubernetes is a container orchestration system that is used to manage the deployment, scaling, and management of application containers across a cluster of nodes. It consists of several components, which can be divided into two categories: master components and node components.
Master Components
The master components are responsible for managing the cluster. It includes the API server, the controller manager, the scheduler, and the etcd distributed key-value store.
- The API server is the main control point for the cluster. It provides the RESTful interface for creating, updating, and deleting objects in the cluster.
- The controller are brain behind the Kubernetes. It is responsible for controlling the state of the cluster, and takes care of tasks such as maintaining the desired number of replicas or containers for a given object. The controllers takes care of bring up new containers in such cases.
- The scheduler is responsible for distributing work or containers across multiple nodes. It looks for newly created containers and assigns them to nodes.
- The etcd distributed key-value store is used to store the cluster’s state, and is used by the other components to ensure that the cluster remains in a consistent state. It is responsible for implementing locks within the cluster ensuring that there are no conflicts between the masters with in the cluster.
Node Components
The node components are responsible for running the workloads on the cluster, and include the kubelet, the kube-proxy, and the container runtimes.
- The kubelet is responsible for managing each node in the cluster, and is responsible for starting, stopping, and managing containers.
- The kube-proxy is responsible for network communication between the containers running on the nodes in the cluster.
- The container runtimes are responsible for running the containers on the nodes. Kubernetes supports a variety of container runtimes, such as Docker and rkt.
Master vs Worker Nodes
In Kubernetes, the nodes can be divided into two categories: master nodes and worker nodes. The master nodes are responsible for managing the cluster, while the worker nodes are responsible for running the workloads.
The master nodes run the master components, such as the API server and the etcd distributed key-value store, while the worker nodes run the node components, such as the kubelet and the container runtimes.
The worker nodes are responsible for running the containers and workloads that make up the application, while the master nodes are responsible for managing the overall state of the cluster.
Service Mesh in Kubernetes
A service mesh is a dedicated infrastructure layer for handling communication between services in a distributed application.
In Kubernetes, service meshes are used to provide an abstraction layer for managing communication between services. It can also provide features such as service discovery, automatic load balancing, and observability.
Kubernetes supports several service mesh implementations, such as Istio, Linkerd, and Consul
Summary
Kubernetes is a container orchestration system with master and node components responsible for managing the cluster and running workloads, respectively.
Master components include the API server, controller manager, scheduler, and etcd distributed key-value store, while node components include the kubelet, kube-proxy, and container runtimes.
Kubernetes also supports service meshes for managing communication between services in a distributed application.