Components tools
1. Etcd
A distributed, reliable key-value store for the most critical data of a distributed system
default port: 2379
./etcdctl set key1 value1
./etcdctl get key1
Every information you see when you run the kubectl get
command is from the Etcd Server.
To list all keys stored by Kubernetes, run the command like this. Run inside the etcd-master POD.
kubectl exec etcd-master -n kube-system etcdctl get / --prefix -keys-only
2. kube-apiserver
Kube-apiserver is the primary management component in kubernetes. When you run a kubectl command, the kubectl utility is infact reaching to the kube-apiserver. The kube-apiser first authenticates the request and validates it. It then retrieves the data from the etcd cluster and reponds back with the requested information.
POST request is available as well.
curl -X POST /api/v1/namespaces/default/pods ...[other]
kube-apiserver is the only component that interacts directly with the etc datastrore.
3. kube-controller-manager
kube-controller-manager manages various controllers in kubernetes. A controller is like an office or department within the master ship that have their own set of responsibilities.
These offices are:
No 1. Continuously on the lookout for the status of the ships
No 2. Take necessary actions to remediate the situation
Node Monitor Period = 5s
Node Monitor Grace Period = 40s
POD Eviction Timeout = 5m
4. kube-scheduler
kube-scheduler is responsible for scheduling pods on nodes. It is only reponsible for deciding which pod goes on which node. It doesn’t actually place the pod on the nodes.
The scheduler decides which nodes the pods are placed on depending on certain criteria. You may have pods with different resource requirements. You can have nodes in the cluster dedicated to certain applications.
1. Filter Nodes
2. Rank Nodes - calculates the amount of resources that would be free on the nodes after placing the pod on them
5. kubelet
The kubelet is like the captain on the ship. They lead all activities on a ship. They’re the ones responsible for doing all the paperwork necessary to become part of the cluster. They’re the sole point of contact from the master ship. They load or unload containers on the ship as instructed by the scheduler on the master. The kubelet in the kubernetes worker node, registers the node with the kubernetes cluster. When it receives instructions to load a container or a pod on the node, it requests the container runtime engine, which maybe Docker, to pull the required image and run an instance. The kubelet then continues to monitor the state of the pod and the containers in it and reports to the kube-apiserver on a timely basis.
6. kube-proxy
kube-proxy is a process that runs on each node in the kubernetes cluster. Its job is to look for new services and every time a new service is created it creates the appropriate rules on each node to forward traffic to those services to the backend pods. One way it does this is using IPTABLES rules.