Upgrade an Extension
Existing extensions can be upgraded by updating the version field in the ClusterExtension resource.
For information on downgrading an extension, see Downgrade an Extension.
Prerequisites
- You have a ClusterExtension installed
- The target version is compatible with OLM v1 (see OLM v1 limitations)
- Any changes to the CustomResourceDefinition in the new version meet compatibility requirements (see CRD upgrade safety)
- You are not attempting to upgrade between minor versions with a major version of zero (see Upgrades within the major version zero)
For more detailed information see Upgrade Support.
Procedure
For this example, we will be using v0.2.0 of the ArgoCD operator. If you would like to follow along
with this tutorial, you can apply the following manifest to your cluster by, for example,
saving it to a local file and then running kubectl apply -f FILENAME:
ArgoCD v0.2.0 manifests
If we view the current state of our ClusterExtension we should see that we have installed version 0.2.0:
-
To initiate our upgrade, let's update the version field in the ClusterExtension resource:
Method 1: apply a new ClusterExtension manifestkubectl apply -f - <<EOF apiVersion: olm.operatorframework.io/v1 kind: ClusterExtension metadata: name: argocd spec: namespace: argocd source: sourceType: Catalog catalog: packageName: argocd-operator version: 0.2.1 # Update to version 0.2.1 EOFAlternatively, you can use
kubectl patchto update the version field: -
We can now verify that the ClusterExtension is updated to the new version:
Note on the kubectl.kubernetes.io/last-applied-configuration annotation
After your upgrade, the contents of the kubectl.kubernetes.io/last-applied-configuration annotation field will
differ depending on your method of upgrade. If you apply a new ClusterExtension manifest as in the first method shown,
the last applied configuration will show the new version since we replaced the existing manifest. If you use the patch
method or kubectl edit clusterextension, then the last applied configuration will show the old version.