Follow the steps below to restore Antrea to a previous version.

Procedure

  1. Prepare the manifests and image (antrea-operator/antrea/antrea-interworking) with the target version.
  2. Restore antrea-operator by replacing the operator image.
    You can either edit operator.yaml or edit the deployment with the command oc -n antrea-operator edit deploy antrea-operator. Make sure that the antrea-operator pod is running.
  3. Restore Antrea and antrea-interworking to a previous version.
    1. Edit antreainstall CR.
      You can either edit operator.antrea.vmware.com_v1_antreainstall_cr.yaml or run the command oc -n antrea-operator edit antreainstall antrea-install. Update antreaImage.
    2. (Optional) If antrea-interworking is enabled, update interworkingImage.
    3. Apply the changes.
  4. Check the status.
    1. Make sure that antrea-controller and antrea-agent are running.
    2. Check the version of clusteroperator antrea with the command oc get co antrea.

    Note:

    If you downgrade from Antrea 1.9 to Antrea 1.8, you may encounter the following error:
    CustomResourceDefinition.apiextensions.k8s.io \"ippools.crd.antrea.io\" is invalid: [spec.conversion.strategy: Required value, spec.conversion.webhookClientConfig: Forbidden: should not be set when strategy is not set to Webhook, status.storedVersions[0]: Invalid value: \"v1beta1\": must appear in spec.versions]"

    Be cautious and plan carefully before you performing a downgrade. You may need to restart all the Pods, which will use the IPPools annotation to get a new IP from IPPools.

    To fix the downgrade error, check if there is any existing custom resource of the CRD ippools.crd.antrea.io. Back up any custom resource with the command kubectl get ippools.v1alpha2.crd.antrea.io -o yaml > ippools-backup.yml. Then run the command kubectl delete crd ippools.crd.antrea.io and wait for antrea-operator to roll back Antrea. You can run kubectl apply -f ippools-backup.yml to recover the custom resources once you confirm that Antrea is the right version.