Changing the Control Plane Ingress IP

By default, the Control Plane Ingress is exposed on the Bootstrap node Control Plane IP, which means that to have a highly available Control Plane Ingress you need to set up a Load Balancer in front of this Control Plane Ingress, that will check for the health of every Control Plane node and redirect the traffic to a Control Plane node IP that is ready.

The MetalK8s Operator allows configuring a Virtual IP that will be managed by MetalK8s and used to expose the Control Plane Ingress, so that you can have a highly available Control Plane Ingress without Load Balancer in front.

This procedure describes how to change the Control Plane Ingress IP, and to enable (or disable) management of this IP as a Virtual IP.

The ClusterConfig layout

kind: ClusterConfig
  name: main
      # Choose between
      # - `managedVirtualIP`: where you need to provide an IP that
      #                       will be manage by MetalK8s as a Virtual IP
      # - `externalIP`: where you need to provide the IP that will be
      #                 used to access the Ingress (e.g.: The Load Balancer IP)
      # externalIP:
      #   address:


  1. Update the main ClusterConfig object as you wish

    kubectl --kubeconfig=/etc/kubernetes/admin.conf \
        edit clusterconfig main
  2. Wait for the ClusterConfig to be ready

    kubectl --kubeconfig=/etc/kubernetes/admin.conf \
        wait --for=condition=Ready \
        clusterconfig main
  3. Refresh the pillar.

    $ salt-call saltutil.refresh_pillar wait=True
  4. Check that the change is taken into account.

    $ salt-call metalk8s_network.get_control_plane_ingress_ip
  5. On the Bootstrap node, reconfigure apiServer:

    $ salt-call state.sls \
        metalk8s.kubernetes.apiserver \
  6. Reconfigure Control Plane components:

    $ kubectl exec -n kube-system -c salt-master \
        --kubeconfig=/etc/kubernetes/admin.conf \
        $(kubectl --kubeconfig=/etc/kubernetes/admin.conf get pod \
        -l "" \
        --namespace=kube-system -o jsonpath='{.items[0]}')  \
        -- salt-run state.orchestrate \
        metalk8s.orchestrate.update-control-plane-ingress-ip \
  7. You can access the MetalK8s GUI using this new IP.