Can we bringup on k8s cluster with initial CP node before kube-vip can start to realise VIP?

We are planning to use kubeadm to bring up a k8s cluster. Its a bare metal k8s cluster (well, these are VMs in vCenter). Plan to use L2 mode of kube-vip to get stable VIP for CP HA.

Can we get the first CP node to be fully configured with VIP passed as config param to “kubeadm init” with “–control-plane-endpoint” before kube-vip is deployed in the cluster.

I can see that all of the kubelet/controller manager/scheduler kubeconf file refer to local IP (or the one passed in --apiserver-advertise-address), not VIP. admin.conf and super-admin.conf refers to VIP, but we may not need to talk to api-server before cluster comes up with this one node.

Therefore, can we do the below without any issues:

  • Run kubeadm init passing VIP to control-plane-endpoint
  • Let cluster come to life
  • Now, deploy kube-vip as daemonset and let the first CP node capture the VIP

And can we do the same thing for additional CP nodes?

Thanks for your help in advance,

vchanna

Hello,

How do you plan to bootstrap nodes with kube-vip, static-pod or daemonSet?

The steps you mentioned, I think you should be using static-pod at least until the cluster is stable, before switching to ds only.

Run kubeadm init with:

--control-plane-endpoint = virtualIP:6443
--apiserver-advertise-address = first node real IP

Once this is done, add other CP nodes.

To join other control plan nodes, VIP must already be active and reachable before running kubeadm join --control-plane.

Let me know if this helps or if there are any specific issues or errors you see.

Thanks,
Manan

Thanks for the response.

The idea is to configure first CP node in the cluster by running “kubeadm init” with --control-plane-endpoint = virtualIP:6443. Once the first node is fully configured, deploy kube-vip as daemonSet.

And now, continue with kubeadm join on other nodes.

The actual question is should we have the kube-vip running as static pod on first CP node before we can fully configure first node, or we can pass yet not active control-plan-endpoint to kubeadm init?

Once the first node of the k8s is fully operational, we can deploy kube-vip as daemonSet which will make first CP node to own the VIP and then that is reachable when “kubeadm join” is run on other nodes.

Thanks,

Yes, have it running as a static pod. Don’t pass the not-yet-active VIP; make it active first via a static Pod.

Thanks for the response. Helps.