Follow the steps below to upgrade Antrea with antrea-operator on Openshift.

Procedure

  1. Prepare the manifests and image (antrea-operator/antrea/antrea-interworking) with the new version.
  2. Update the role with the command oc apply -f role.yaml.
  3. Upgrade antrea-operator by replacing the old image with the new 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.
  4. (VMware Container Networking with Antrea 1.8.0 or earlier) Upgrade Antrea and antrea-interworking.
    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 with the new image.
    2. (Optional) If antrea-interworking is enabled, update interworkingImage with the new antrea-interworking image.
    3. Apply the changes.
  5. (VMware Container Networking with Antrea 1.9.0 or later) Upgrade Antrea and antrea-interworking.
    1. Apply the new CRD.
      oc apply -f operator.antrea.vmware.com_antreainstalls_crd.yaml 
      customresourcedefinition.apiextensions.k8s.io/antreainstalls.operator.antrea.vmware.com configured
    2. Edit operator.antrea.vmware.com_v1_antreainstall_cr.yaml and update the following fields:
      • antreaAgentImage: <Change this to Image Path>
      • antreaControllerImage: <Change this to Image Path>
    3. Trigger the upgrade.
      oc apply -f operator.antrea.vmware.com_antreainstalls_crd.yaml 
      customresourcedefinition.apiextensions.k8s.io/antreainstalls.operator.antrea.vmware.com configured
    4. Apply the changes.
  6. 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:

    When upgrading from Antrea 1.8 to Antrea 1.9, you may encounter the following error:
    CustomResourceDefinition.apiextensions.k8s.io \"clustergroups.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]"
    To fix the issue, perform the following step and wait for antrea-operator to recover by itself.
    manager_index="$(kubectl get crd "clustergroups.crd.antrea.io" --show-managed-fields --output json | jq -r '.metadata.managedFields | map(.manager == "antrea-controller") | index(true)')"
    kubectl patch crd "${crd_name}" --type=json -p="[{\"op\": \"remove\", \"path\": \"/metadata/managedFields/${manager_index}\"}]"