How to configure kube-proxy master_url with multiple apiservers

I am using a cluster setup with several front-balancer apiservers for external access, with bare metal installation.

As mentioned in Kubernetes Clocksers high availability docs , I would like to use internal loadbalancing using the kubernetes service in my cluster. This is good so far, but I'm not sure what is the best way to configure kube-proxy . Obviously, it cannot use the IP address of the service, since it proxies this object based on data received from apeeperver ( master ). I could use the IP of any of the apiservers, but this could result in a loss of high availability. So the only viable option that I can see right now is to use my external loadbalancer, but that seems to be something wrong.

Anyone have any ideas or best practices?

+5
source share
2 answers

This is a pretty old question, but as the problem persists, here it is.

There is an error in Kubernetes restclient that does not allow you to use more than one IP / URL, as it will always display the first IP address in the list. This affects kube-proxy, as well as kubelet, leaving one point of failure in these tools if you do not use a load balancer (like you) in a multi-wizard setup. The solution is probably not the most elegant solution ever, but currently (I think) it is easier.

Another solution (which I prefer, but may not work for everyone, and it does not solve all problems) is to create a DNS record that will cover your API servers, but, as indicated in one of the links below, that only solves load balancing , not HA.

You can see the progress of this story in the following links:

Kube-proxy / kubelet problem: https://github.com/kubernetes/kubernetes/issues/18174
Restclient PR: https://github.com/kubernetes/kubernetes/pull/30588
The "official" solution: https://github.com/kubernetes/kubernetes/issues/18174#issuecomment-199381822

+1
source

I think it should be configured so that you have a kube proxy on each master node, so every kube proxy points to its master at 127.0.0.1/localhost

The submaster determines which api server should start, which in turn uses the local proxy of this wizard

0
source

Source: https://habr.com/ru/post/1237921/


All Articles