Upgrading the Autonomous Operator

Step 1: Download the New Operator Package

Download the Operator package for the version that you want to upgrade to, and unpack it on the same computer where you normally run kubectl or oc.

The Operator package contains the YAML configuration files and command-line tools that you will use to upgrade and manage the Operator.

After you unpack the download, the resulting directory will be titled something like couchbase-autonomous-operator-kubernetes_x.x.x-linux_x86_64. Make sure to cd into this directory before you run the commands in this guide.

Step 2: Uninstall the Old Operator

What needs to be uninstalled is dependent on the release you are upgrading from. For example, in releases prior to 1.2.0, the Operator used ClusterRole resources for simplicity of configuration. From 1.2.0 onward, the operator uses Role resources to increase security.

In general, you’ll need to undo the installation steps in reverse order for the specific version of the Operator you are upgrading from.

Never delete existing CRDs. If an existing CRD is deleted, any CouchbaseCluster resources will also be deleted.

To uninstall version 1.2.0 of the Operator, first change into the original install package directory, then perform the following steps:

  • Kubernetes

  • OpenShift

  1. Uninstall the Operator from all namespaces.

    kubectl delete --namespace default -f operator-deployment.yaml
    kubectl delete --namespace default -f operator-role-binding.yaml
    kubectl delete --namespace default -f operator-role.yaml
    kubectl delete --namespace default -f operator-service-account.yaml
  2. Uninstall the Dynamic Admission Controller.

    kubectl delete -f admission.yaml
  1. Uninstall the Operator from all namespaces.

    oc delete --namespace default -f operator-deployment.yaml
    oc delete --namespace default -f operator-role-binding.yaml
    oc delete --namespace default -f operator-role.yaml
    oc delete --namespace default -f operator-service-account.yaml
  2. Uninstall the Dynamic Admission Controller.

    oc delete -f admission.yaml

Step 3: Update the CRD

In the Operator package you downloaded, you’ll find the updated version of the CRD: crd.yaml. For minor releases of the Operator, the CRD (which defines acceptable CouchbaseCluster configurations) may undergo small changes that don’t affect backward compatibility, but may add new fields or make changes to the validation code that ensures valid CouchbaseCluster configurations.

To update the CRD, run the following command:

  • Kubernetes

  • OpenShift

kubectl replace -f crd.yaml
oc replace -f crd.yaml

Step 4: Install the New Operator

After updating the CRD, you can move on to upgrading the Operator itself. Upgrading the Operator is exactly the same as the initial installation, except that you don’t re-install the CRD.