Pages

Tuesday, August 7, 2018

Work Node Components - kubelet, kube-proxy & Runtime

Share it Please
Work Node Components
Now once the components are ready on the Master node, we need to understand the components that run the worker nodes. The worker nodes are basically where our workload runs. These are the nodes where we run our application containers etc.

Kubelet
In simple terms , kubelet is a process that run on the every worker node of the cluster to perform jobs like creating pod etc. The first thing it does is to register the node it is running with the Api server. Then it continuously monitors the Api server for pods that have been scheduled on that node. One identified it tells the underlying container runtime like docker to start the containers. The Kubelet is also the component that runs the container liveness probes, restarting containers when the probes fail.

The Kubelet constantly monitors running containers and reports their status, events, and resource consumption to the API server. This is the component which will send all details regarding the node to Api server which intrun save them to the etcd. Checking these details ,the scheduler will identify other details and select the correct node for pods hosting.

Kube-Proxy  
Kube-proxy is a network proxy and a load balancer which reflects kubernetes networking services on each node. Every worker node will have a kube-proxy whose purpose is to make sure clients can connect to the services we define using the Kubernetes Api. kube-proxy will take care of making sure the when someone hits the service IP with a port , it sends the request to the Pod that is actually backing the service.

Now once we create a pod, we need to have something to access the application running in that pod. Now this some thing is called services in k8. Every service will have a name and a end point ( which is the original application point to connect ). Kube-proxy will always watch for the endpoints for all services in the cluster. This will then re-program the network on its node, so that network requests to the ip address of the service will be re routed to the original endpoint.Every Service in Kubernetes gets a virtual IP address, the kube-proxy is the daemon responsible for defining and implementing the local load-balancer that routes traffic from Pods on the machine to Pods, anywhere in the cluster, that implement the Service.

It also does the job of load balancing if multiple pods are backing a service. When a client makes a call to a service, Iptables come in between intercept the request and forwards to the kube-proxy which in turn send that to the pod backing the service.

Kubernetes proxy can be used to access a pod locally without exposing that. Generally when you start the kube-proxy the service are accessible on the host where the kube-proxy is started.


Container Runtime - Container runtime is same for both master and worker nodes.Container runtime is a software responsible for running containers. K8 supports several runtime including docker,rkt,runc and any OCI runtime spec implementation

No comments :

Post a Comment