×

All user-created FRR-K8s custom resources (CRs) in the metallb-system namespace under OKD 4.17 and earlier releases must be migrated to the openshift-frr-k8s namespace. As a cluster administrator, complete the steps in this procedure to migrate your FRR-K8s custom resources.

Migrating FRR-K8s resources

You can migrate the FRR-K8s FRRConfiguration custom resources from the metallb-system namespace to the openshift-frr-k8s namespace.

Prerequisites
  • You have installed the OpenShift CLI (oc).

  • You are logged in to the cluster as a user with the cluster-admin role.

Procedure

When upgrading from an earlier version of OKD with the Metal LB Operator deployed, you must manually migrate your custom FRRConfiguration configurations from the metallb-system namespace to the openshift-frr-k8s namespace. To move these CRs, enter the following commands:

  1. To create the openshift-frr-k8s namespace, enter the following command:

    $ oc create namespace openshift-frr-k8s
  2. To automate the migration, create a shell script named migrate.sh with the following contents:

    #!/bin/bash
    OLD_NAMESPACE="metallb-system"
    NEW_NAMESPACE="openshift-frr-k8s"
    FILTER_OUT="metallb-"
    oc get frrconfigurations.frrk8s.metallb.io -n "${OLD_NAMESPACE}" -o json |\
      jq -r '.items[] | select(.metadata.name | test("'"${FILTER_OUT}"'") | not)' |\
      jq -r '.metadata.namespace = "'"${NEW_NAMESPACE}"'"' |\
      oc create -f -
  3. To execute the migration, run the following command:

    $ bash migrate.sh
Verification
  • To confirm that the migration succeeded, run the following command:

    $ oc get frrconfigurations.frrk8s.metallb.io -n openshift-frr-k8s

After the migration is complete, you can remove the FRRConfiguration custom resources from the metallb-system namespace.