0

I have 3 compute engines (VMs) from a cloud provider, and I can connect to them using my SSH key and their public IP.
I want to run a Kubernetes cluster (1 master, 2 workers) using kubelet on these machines, and the question arises when I want to address the nodes.
Each machine has a VPC IP in 192.168.x.x and a public one in 183.x.x.x; when advertising the master node and joining workers, which IP should I use?

for example, on the master node, I need to advertise the master node IP using this command:

kubeadm init --apiserver-advertise-address=[Master Node IP] --pod-network-cidr=10.15.0.1/16

Considering that these VMs are connected through VPC private IPs, is it recommended to use public IPs for advertising the master node and joining worker nodes?

abexamir
  • 3
  • 2

1 Answers1

0

You should avoid using public IP addresses wherever you can. A public IP address means anyone can try to connect to your cluster. If you use the VPC, you will be isolated from the rest of the network. That is good and safe solution. You should use public IP addresses only where is absolutely necessary. Inside the cluster you should also use private IPs. If you need to expose your application to the internet, you can use ingress or service mesh architecture like istio.