ob-operator simplifies the deployment and management of OceanBase clusters in Kubernetes. You can use either of the following methods to deploy ob-operator:
Use Helm to deploy ob-operator
Before you use Helm commands to deploy ob-operator, you must install Helm. After Helm is installed, run the following command to deploy ob-operator:
helm repo add ob-operator https://oceanbase.github.io/ob-operator/
helm install ob-operator ob-operator/ob-operator --namespace=oceanbase-system --create-namespace --version=1.2.0
where
namespacespecifies the namespace, which can be customized.versionspecifies the version of ob-operator. The current version is V1.2.0.
Use configuration files to deploy ob-operator
You can deploy ob-operator by using configuration files in either of the following ways:
Use the default configuration files: You can run the following commands to directly use the configuration files on GitHub for deployment:
# deploy CRD kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/master/deploy/crd.yaml # deploy ob-operator kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/master/deploy/operator.yamlUse custom configuration files: You can download the configuration files from GitHub, modify the files as needed, and then deploy ob-operator by using the modified files.
Download the configuration files.
# download the config file wget https://raw.githubusercontent.com/oceanbase/ob-operator/master/deploy/crd.yaml wget https://raw.githubusercontent.com/oceanbase/ob-operator/master/deploy/operator.yamlModify the configuration files as needed, and then run the following commands to deploy ob-operator:
# after making some modification kubectl apply -f crd.yaml kubectl apply -f operator.yaml
View the deployment result
Run the following command to view the CRDs:
kubectl get crds
The following output indicates that the CRDs are deployed.
backups.cloud.oceanbase.com 2023-06-16T11:02:15Z
obclusters.cloud.oceanbase.com 2023-06-16T11:02:15Z
obzones.cloud.oceanbase.com 2023-06-16T11:02:15Z
restores.cloud.oceanbase.com 2023-06-16T11:02:15Z
rootservices.cloud.oceanbase.com 2023-06-16T11:02:15Z
statefulapps.cloud.oceanbase.com 2023-06-16T11:02:15Z
tenantbackups.cloud.oceanbase.com 2023-06-16T11:02:15Z
tenants.cloud.oceanbase.com 2023-06-16T11:02:15Z
Run the following command to check whether ob-operator is deployed:
kubectl get pods -n oceanbase-system
The following result is returned. If all the containers are ready and in the running state, ob-operator is deployed.
NAME READY STATUS RESTARTS AGE
ob-operator-controller-manager-78587645d-w7vbk 2/2 Running 0 18d