Suppose I have a ClusterIP service S associated with 10 pods. When a request is routed to the service (from the ingress controller, for example) how does it get routed to a pod?
I know someone manipulates the k8s DNS to map the service name to one single pod out of the 10. I also know that that someone constantly changes this mapping to try and route traffic to all the pods at the end of the day. What I do NOT know is what k8s component exactly is that someone and more importantly – what is the logic it uses to select the pod to which the next request will be routed?
Amazingly, I could not find k8s documentation that replies to the second question. It seems the answer to the first question is kube-proxy
, but I am not sure. Would be very helpful to get the exact documentation for that part also.
I use AKS. It has calico
installed, if that matters.
3