Kubernetes is a combination of multiple parts working together to get the container job done and the most vital part of it is Master node . The node acts as brain to the cluster and manages the whole ecosystem .
Master connects to etcd via HTTP or HTTPS to store the data and also connects flannel to access the container application.
Worker nodes engage with master via HTTP or HTTPS to get a command and report the status.
Overlay network makes connections of their container applications. All of it will be discussed below for more in-depth
Below are the mentioned components :
etcd
-
The heart of any Kubernetes cluster that implements a distributed key value store where all of the objects in a kubernetes cluster are persisted .
-
It works on a algorithm which has replication techniques across servers to maintain the data stored in etcd .
-
Optimistic concurrency is also used to compare-and-swap data across etcd server , when a user reads and update a value , the system checks that no other component in the system has updated the same value . This technique removes the locking mechanism that increases the server throughput .
-
Another technique known as watch protocol , which accounts for changes made in key value pair in etcd directory . Its improves efficiency to the client as it wait for the changes and then react to the change without continuous polling to the server .
kube-apiserver
As the name connects , its a server that provides an HTTP- or HTTPS-based RESTful API that is allowed to have direct access to the Kubernetes cluster .
-
Its a connector between all the kubernetes components and mediates all interactions between clients and the API objects stored in etcd .
-
Api server database is external to it , so it is a stateless server which is replicated 3 times to implement fault-tolerance
-
The APIs are exposed and managed by the server , the characteristics of those API requests must be described so that the client and server know how to communicate .
-
Define API pattern where the request is defined like api paths or groups.
-
Internal loops are responsible for background operations like CRD (Custom Resource Definitions) which inherently creates new paths for API requests
kube-controller-manager
The controller manager is a general service that has many responsibilities.
-
Controller manager is a collection of control loops rolled up into one binary
-
Manages Kubernetes nodes
-
The control loops needed to implement the functionality like replica sets and deployments are run by Manager
-
Creates and updates the Kubernetes internal information
-
changes the current status to the desired status
kube-scheduler
-
It is a simple algorithm that defines the priority to dispatch and is responsible for scheduling pods into nodes .
-
is continuously scanning the API server (with watch protocol) for Pods which don’t have a nodeName and are eligible for scheduling
-
Node affinity provide a simple way to guarantee that a Pod lands on a particular node
-
Predicates is a concept that helps in making correct resource requirements for the pods
-
Data locality