Install the Operator on Kubernetes

    +
    This guide walks through the recommended procedure for installing the Couchbase Autonomous Operator on an open source Kubernetes cluster that has RBAC enabled.

    If you are looking to upgrade an existing installation of the Operator, see Upgrading the Autonomous Operator.

    Prerequisites

    Download the Operator package and unpack it on the same computer where you normally run kubectl. The Operator package contains YAML configuration files and command-line tools that you will use to install 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.

    All commands in this guide are run as a system administrator account; they require the creation of cluster scoped resources or the granting of roles to service accounts (privilege escalation).

    Install the CRD

    The first step in installing the Operator is to install the custom resource definitions (CRD) that describe the Couchbase resource types. This can be achieved with the following command:

    $ kubectl create -f crd.yaml

    Install the Operator

    The operator is composed of two components; a per-cluster dynamic admission controller (DAC) and a per-namespace Operator. Refer to the operator architecture document for additional information on what is required and security considerations.

    The following command will install both the DAC and the Operator into the default namespace.

    $ bin/cbopcfg | kubectl create -f -

    Custom Installation

    Alternatively, you may wish to install just the DAC in the camelot namespace:

    $ bin/cbopcfg --no-operator --namespace camelot | kubectl create -f -

    And then install just the Operator into the asgard namespace:

    $ bin/cbopcfg --no-admission --namespace asgard | kubectl create -f -

    For further installation options please see the cbopcfg reference manual.

    Versions prior to 2.0.2

    If you’re installing version 2.0.0 or 2.0.1 of the Autonomous Operator, you’ll need to explicitly provide the namespace in kubectl (otherwise, the deployment will be created in the default namespace).

    $ bin/cbopcfg --no-operator --namespace camelot | kubectl create -n camelot -f -
    $ bin/cbopcfg --no-admission --namespace asgard | kubectl create -n asgard -f -

    Check the Status of the Operator

    You can use the following command to check on the status of the deployments:

    $ kubectl get deployments
    NAME                           READY   UP-TO-DATE   AVAILABLE   AGE
    couchbase-operator             1/1     1            1           8s
    couchbase-operator-admission   1/1     1            1           8s

    The Operator is ready to deploy CouchbaseCluster resources when both the DAC and Operator deployments are fully ready and available.

    Uninstalling the Operator

    Uninstalling the DAC and Operator is the reverse of the installation process:

    $ bin/cbopcfg | kubectl delete -f -
    $ kubectl delete -f crd.yaml