cbopcfg
cbopcfg
is a command-line tool that is provided in the Couchbase Autonomous Operator package.
It is used to generate resource configuration to quickly configure and run the Operator.
The cbopcfg
is not intended to allow configuration of every aspect of the Operator.
We provide Helm charts to allow more complex deployment scenarios.
Installation
Make sure that you have downloaded the Operator package and unpacked it.
After you unpack the download, the resulting directory will be titled something like couchbase-autonomous-operator-kubernetes_x.x.x-linux_x86_64
.
-
Open a Terminal window and go to the directory where the
cbopcfg
binary is located:$ cd couchbase-autonomous-operator-kubernetes_x.x.x-macos_x86_64/bin/
-
Make the
cbopcfg
binary executable:$ chmod +x ./cbopcfg
-
Move the binary into your PATH:
$ sudo mv ./cbopcfg /usr/local/bin/cbopcfg
-
Open a command prompt and go to the directory where the
cbopcfg
binary is located:$ cd couchbase-autonomous-operator-kubernetes_x.x.x-linux_x86_64/bin/
-
Make the
cbopcfg
binary executable:$ chmod +x ./cbopcfg
-
Move the binary into your PATH:
$ sudo mv ./cbopcfg /usr/local/bin/cbopcfg
-
Open a command prompt and go to the directory where the
cbopcfg
binary is located:$ cd couchbase-autonomous-operator-kubernetes_x.x.x-windows_x86_64\bin\
-
Add the
cbopcfg
binary into your PATH.
Commands
cbopcfg generate admission
This command generates YAML to the console that is necessary to create the dynamic admission controller. By default this is installed at the cluster scope.
The following options are provided:
- -n, --namespace <string>
-
If specified, this will override the default namespace
default
. - -i, --image <string>
-
If specified, this will override the default admission controller image
couchbase/admission-controller:2.1.0
. - -p, --image-pull-secret <string>
-
If specified, this will add the image pull secret name to all deployments. This is required when pulling images from private container repositories such as the Red Hat container registry.
- -s, --scope <string>
-
If specified, this will override the default scope
cluster
. When using thenamespace
scope, then the dynamic admission controller will be deployed with a KubernetesRole
. This limits the ability of the admission controller for security reasons, while maintaining full functionality. When deployed with thenamespace
scope, you must also specify the--namepsace-selector
option. - --namespace-selector <string>
-
If specified, this configures admission webhooks to select a DAC instance in a specific namespace. This flag is required when
--cluster
is not set and--no-admission
is not set e.g. you are creating a namespaced DAC.The format of the flag is a set of key/value pairs e.g.
key=value
orkey1=value1,key2=value2
, where both keys and values are strings. These key/value pairs define a label selector that defines what namespace the DAC is being installed into. Kubernetes does not allow the selection of named namespaces, only labeled namespaces.For example, if you wanted to install the DAC into namespace
foo
first you would label it:$ kubectl label namespace foo namespace-name=foo
Then finally reference it in your DAC configuration:
$ cbopcfg generate admission --scope namespace --namespace-selector namespace-name=foo
- --file
-
If specified, individual YAML files are created rather than all output going to the console.
cbopcfg generate operator
This command generates YAML that is necessary to deploy the Operator. By default this is installed at the namespace scope.
The following options are provided:
- -n, --namespace <string>
-
If specified, this will override the default namespace
default
. - -i, --image <string>
-
If specified, this will override the default operator image
couchbase/operator:2.1.0
. - -p, --image-pull-secret <string>
-
If specified, this will add the image pull secret name to all deployments. This is required when pulling images from private container repositories such as the Red Hat container registry.
- -s, --scope <string>
-
If specified, this will override the default scope
namespace
. By default the Operator will run in a namespace and will not be able to see resources in another namespace. This option may be set tocluster
that will allow a single Operator instance to control Couchbase clusters in all namespace in the Kubernetes cluster. - --file
-
If specified, individual YAML files are created rather than all output going to the console.
Examples
To create configuration to run the operator in the default
namespace.
$ cbopcfg generate operator | kubectl create -f -
To create a configuration file:
$ cbopcfg generate operator > operator.yaml
To create configuration to run on Red Hat OpenShift:
$ cbopcfg generate operator --namespace myproject --image-pull-secret my-redhat-docker-credentials > operator.yaml