Unable to setup kuberenetes with VM binded with Public IP

3/7/2019

I took a Ubuntu VM from some cloud service with the public IP and trying to do kubeadm init --apiserver-advertise-address=<public ip> but it always fail with error as follows:-

Unfortunately, an error has occurred: timed out waiting for the condition

This error is likely caused by: - The kubelet is not running - The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled)

But it is working, if I try it by VM's private IP. Do someone have any idea why it is happening. Or any idea to setup cluster using public ip.

-- Yash Gupta
kubernetes

1 Answer

3/26/2019

kube-apiserver is configured with hostNetwork: true which means it uses node network system.

Cloud VM PublicIP usually isn't configured on the VM's interface, so you can't use it for apiserver-advertise-address=. kubelet just can't bind kube-apiserver process to nonexistent local interface. It works well only if you specify IP address, configured on master's node VM interface and which is accessible from worker nodes.

-- VAS
Source: StackOverflow