Kubernetes Load balancing among pods

8/21/2018

I made a deployment and scaled out to 2 replicas. And I made a service to forward it.

I found that kube-proxy uses iptables for forwarding from Service to Pod. But I am confused that which one is actually responsible for load-balancing.

Service or Kube-proxy?

-- sury
kubernetes

1 Answer

8/22/2018

Actually it's iptables that's responsible for load-balancing.

At the beginning, you setup a service. At the same time, kube-proxy is watching at the apiserver to get the new service, and setup iptables rules. last, when somebody try to access the service ip, iptables fowarding the request to actual pod ip according to the rules.

-- Kun Li
Source: StackOverflow