Problem
Kubernetes API is not available via virtual IP address (VIP).
Solution
When you install the cluster with the dkp create
command, ensure that
- the control plane nodes are in the same subnet and layer-2 network
- virtual IP address (
--control-plane-endpoint
) is a free IP address from that subnet - network interface for Virtual IP address (
--virtual-ip-interface
) is the same interface on which kube-apiserver listens. kube-apiserver listens on a default interface. You can use the following command to find the default interface:route | grep default
- L2 switches in your infrastructure do not block Gratuitous ARP packets. kube-vip uses Gratuitous ARP to advertise the virtual IP for the control plane; if the switch blocks these packets then fail-over between control plane nodes will not work.
Example
If we have the following networking configurations on the control plane nodes:
Control plane node 1:
eth0: 1.2.3.4/29
eth1: 10.1.2.1/24
Control plane node 2:
eth0: 5.6.7.8/25
eth1: 10.1.2.2/24
Control plane node 3:
eth0: 9.10.11.12/30
eth1: 10.1.2.3/24
then dkp create
command should look like this:
dkp create cluster preprovisioned \
--cluster-name ${CLUSTER_NAME} \
--control-plane-endpoint-host 10.1.2.0 \
--virtual-ip-interface eth1