Kube-Proxy
With in a kubernetes cluster everty pod can reach every other pod. This is accomplished by deploying Pod networking solution to the cluster.
A Pod Network is an internal virtual network that spans across all the nodes in the cluster to which all the Pods connect to this network they are able to communicate with each other. There are many solutions available to deploy such a network.
In the first scenario :
1. I have an application installed in the first node
2. Database installed in the second node.
The webapplication reach the database simply by using the IP of the Pod. But there is no guarantee that the IP of the database Pod will remain the same.
You must know that the better way to access the database is using a service . so we create a service to expose the database application across the cluster. The web application can now access the database by using the name of the service.
The service also gets an IP Address assigned to it whenever a Pod reaches using its IP it forward the request to the Backend pod to the database.
But what is a service and how does it get an IP. Does the service join the same Pod network
Service is a virtual component that exist in the kubernetes memory and Kube-proxy that runs on each node and that looks for services in the cluster and whenever it discovers the service it create the IP Table that forward the request that is going to the service to the end point servers.
The routing and IP routing rule is written by the kube-proxy .
Install Kube-Proxy :
Download the kube-proxy binary from kubernetes release page . Extract it and run it as a service. extract it and run it as a service.
The kubeadm tool deploys kube-proxy as Pods in each node . In fact it is deployed as a deamon set so a single pod is deployed on each node in the cluster. If you don't know about deamon set don't worry.
Comments
Post a Comment