Change a Workload Plane CIDR

Important

The following procedure should only be performed with the assistance of Scality Support

This procedure enables you to change the CIDR of the workload plane. It is used:

  • When you need to segregate the control plane and the workload plane traffic after a single network ARTESCA installation to add a new workload plane on which the data traffic transits. In this case, you need to have the NICs available and configured with IPs belonging to the targeted data CIDR network on each node.

  • When you need to change the CIDR of the workload plane on a segregated network.

Important

This procedure does not apply to the ARTESCA+ Veeam Unified Software Appliance.

Procedure

  1. Update the bootstrap configuration file /etc/metalk8s/bootstrap.yaml so that it uses the new workload plane network.

    [artesca-os@bootstrap ~]$
    
    sudo salt-call --local state.single file.serialize \
       /etc/metalk8s/bootstrap.yaml \
       dataset="{ \
          'networks': { \
             'workloadPlane': { \
                'cidr': '<new_cidr>' \
             } \
          } \
       }" \
       serializer=yaml merge_if_exists=True show_changes=True
    
  2. Export the MetalK8s version you are using as an environment variable:

    [artesca-os@bootstrap ~]$
    
    export MK8SVERSION=`sudo kubectl \
        --kubeconfig=/etc/kubernetes/admin.conf \
        get cm -n kube-system artesca-version \
        -o jsonpath="{.data.metalk8s}"`
    
  3. Update the IPs for the detected nodes.

    [artesca-os@bootstrap ~]$
    
    sudo kubectl exec -n kube-system -c salt-master \
      --kubeconfig /etc/kubernetes/admin.conf \
      $(sudo kubectl --kubeconfig /etc/kubernetes/admin.conf \
        get pods -n kube-system -l app=salt-master -o name) \
      -- salt '*' state.sls metalk8s.node.grains saltenv=metalk8s-$MK8SVERSION
    
  4. Reconfigure the nodes.

    [artesca-os@bootstrap ~]$
    
    sudo kubectl exec -n kube-system -c salt-master \
      --kubeconfig /etc/kubernetes/admin.conf \
      $(sudo kubectl --kubeconfig /etc/kubernetes/admin.conf \
        get pods -n kube-system -l app=salt-master -o name) \
      -- salt-run  state.sls metalk8s.kubernetes.cni.calico.deployed,metalk8s.addons.nginx-ingress.deployed saltenv=metalk8s-$MK8SVERSION
    
  5. Restart the ingress pod.

    [artesca-os@bootstrap ~]$
    
    sudo kubectl --kubeconfig /etc/kubernetes/admin.conf \
       rollout restart -n metalk8s-ingress \
       daemonset/ingress-nginx-controller
    
  6. Wait for the ingress pod to be ready.

    [artesca-os@bootstrap ~]$
    
    sudo kubectl --kubeconfig /etc/kubernetes/admin.conf \
       rollout status --timeout 5m \
       -n metalk8s-ingress daemonset/ingress-nginx-controller
    
  7. Refresh the pillar data.

    [artesca-os@bootstrap ~]$
    
    sudo kubectl exec -n kube-system -c salt-master \
      --kubeconfig /etc/kubernetes/admin.conf \
      $(sudo kubectl --kubeconfig /etc/kubernetes/admin.conf \
        get pods -n kube-system -l app=salt-master -o name) \
      -- salt '*' saltutil.refresh_pillar