The Couchbase Autonomous Operator 2.3.0 release provides some exciting improvements to lifecycle automation with the cao utility. This utility improves previous configuration tools by consolidating provisioning and facilitating supportability with the addition of a self-certification feature. To get started, download the Cloud-Native Database package and unpack it to the same directory where you normally run kubectl.
Out with the old
In previous releases, the Autonomous Operator installation was performed by the cbopcfg tool. This tool also performed other actions such as creating backup roles and template generation. As of the 2.3.0 release, all of this functionality has been deprecated within cbopcfg and moved to the cao utility.
Furthermore, the previous supportability provided by the cbopinfo utility for log and resource collection has also been deprecated. As of the 2.3.0 release, the same supportability features now exist within the cao utility, along with additional functionality for self-certification.
In with the improved
As you get started with the cao utility, you’ll find that all the old features provided in previous releases exist with similar syntax. The help menu gives an overview of the commands provided by the cao utility:
1 2 3 4 5 6 7 8 9 10 11 |
Available Commands: certify Runs the platform certification suite collect-logs Log and resource collection for Couchbase Autonomous Operator support completion generate the auto completion script for the specified shell create Creates Couchbase Autonomous Operator components delete Deletes Couchbase Autonomous Operator components generate Generates YAML manifests help Help about any command restore Restore a cluster's data topology save Save a cluster's data topology version Prints the command version |
Use the create command to create both the Autonomous Operator and Admission Controller to get started.
1 2 |
cao create operator cao create admission |
The Autonomous Operator will be used to certify and manage the cluster you will create in the following steps. The admission controller provides validation and verification of every resource within the Autonomous Operator ecosystem.
Testing autonomous cluster creation
Now that the Autonomous Operator is running, you can run platform certification to ensure the supportability of your environment. For the sake of brevity, you can run a single certification test. When preparing a cluster for production purposes, you will want to run the entire certification suite.
1 |
cao certify --clean -- -test TestCreateCluster |
One-off certification can help troubleshoot a failing test or validate a particular aspect of your cluster. For instance, if you wanted to get quick feedback on the validity of your storage layer, you could run the TestPersistentVolumeCreateCluster test to verify the success of cluster creation with persistent volumes. Available tests will be listed at the start of every full certification run in case you need to reference others.
Saving cluster topology
Next, you can create a standalone cluster using the Couchbase helm chart. Since the Autonomous Operator and Admission Controller are already created, disable these deployments when installing the chart to ensure that only the Couchbase Cluster is installed:
1 2 3 |
helm install cb-example --set install.couchbaseOperator=false \ --set install.admissionController=false \ couchbase/couchbase-operator |
This command creates a Couchbase Cluster consisting of 3 Pods. When all of the Pods are running, and the bucket is created, then the cao save command can be used to save the Cluster’s data topology. The save feature converts all discovered resources into native Kubernetes resource types, preserving all configuration and linkage information.
1 |
cao save --couchbase-cluster cb-example --filename cb-example.yaml |
Saving cluster topology is especially beneficial for use cases involving several buckets with specific scope and collection rules for merging or restoring to additional clusters. For further information, refer to the documentation regarding save and restore functionality.
Lifecycle considerations
As with any tool, understanding when and how to use this utility is important from a full end-to-end perspective. Fortunately, the cao utility is an excellent choice for any installation scenario, as it can set up both development and production scale environments.
However, it is important to note that this utility is not a full end-to-end solution for Couchbase Server Provisioning. While cao can deploy the management resources (e.g., Operator and Admission controllers), you will need to manually provision your own cluster separately.
While you may be able to mix and match the use of this tool with other installers such as helm to perform cluster installation as demonstrated above, it is recommended to avoid piecemealing installers as this may complicate the upgrade process down the road. In many ways, the power of the cao utility along with plain kubectl can be an advantage for creating modular integration and deployment pipelines that involve the basic operator deployment alongside several custom cluster configurations.
Further reading
Couchbase Autonomous Operator documentation covers all the topics that we covered above; read more about them here: