How to use kubeadm-init configuration parameter- "controlPlaneEndpoint"?

Solution 1:

We are suffering the exact same problem, but with the Azure Load Balancer (Level 4).

1) It fails on the first master node where "kubeadm init" is executed because it tries to communicate with itself through the load balancer.

2) On all the other master nodes where "kubeadm join" is executed, there's a 1/N chance of failure when the load balancer selects the node itself and not any of the (N-1) nodes that are already in the cluster.

We hacked our way by using iptables rules. For instance, in the first node before "kubeadm init" we make iptables to route the load balancer ip to 127.0.0.1:

iptables -t nat -A OUTPUT -p all -d ${FRONTEND_IP} -j DNAT --to-destination 127.0.0.1

Of course we delete the iptables rule after kubeadm init. I'm not recommending anybody to do this, it's a nasty hack and my intention with this post is to compel somebody who may know what we are missing to please post what the right solution is.

To the original poster: I don't think the intention is that we use a Level 7 LB. The documentation is clear when they say that a Level 4 is all that's needed.

I'll post again if we find the right solution.