A newer version of this documentation is available.

View Latest

Upgrade the Operator


      There is no direct upgrade path from versions prior it 2.0.x. To upgrade from a version 1.x.x release, first upgrade to 2.0.x paying particular attention to supported Kubernetes platforms and Couchbase server versions.

      Upgrading the Couchbase Autonomous Operator is a four-step process:

      Additional steps may be required on a per-release basis, consult the what’s new? and release notes for details.

      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 DAC and 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, e.g. uninstall the operator, then uninstall the DAC.

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

      To uninstall the current Operator version, instructions are provided for Kubernetes and OpenShift.

      Step 3: Update the CRDs

      In the Operator package you downloaded, you’ll find the updated version of the CRDs: crd.yaml. Between releases of the Operator, the CRDs may undergo small changes that don’t affect backward compatibility, and may add new fields or make changes to validation, therefore must be reinstalled. New CRDs may also be introduced that need installing.

      CRDs are distributed as a single file. During the upgrade procedure, errors are expected during the create operation if a CRD already exists for a resource type.

      To update the CRDs, run the following command:

      • Kubernetes

      • OpenShift

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

      Step 4: Install the New Operator

      After all the previous steps, 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. To re-install the Operator in all namespaces where previous instances operated on, see the relevant documentation for Kubernetes or OpenShift.