How to install the Altinity ClickHouse-Operator to your Kubernetes environment
1 March 2023 · Read time 4 min
Introduction - Altinity ClickHouse-Operator
This page provides instructions to deploy the Altinity Kubernetes Operator to your Kubernetes environment.
The following items are required:
- Kubernetes version 1.15.11 or later
- Kubernetes Install Tools - the Altinity installation instructions for your environment
- clickhouse-operator-install-bundle.yaml - this is the latest (master branch) of the Altinity ClickHouse deployment YAML file
For Other Altinity deployment YAML file versions
To find other versions of the deployment YAML file, visit our Altinity clickhouse-operator site and use the GitHub branch menu Switch branches/tags to find a specific version.
- https://github.com/Altinity ⧸ clickhouse-operator ⧸ deploy ⧸ operator ⧸
This example shows how to deploy version 0.20.3 of
clickhouse-operator-install-bundle.yaml from the Altinity GitHub repository.
NOTE: Altinity recommends that you deploy a specific version, rather than using the latest clickhouse-operator YAML file from the master branch.
To install a specific version of the Altinity Kubernetes Operator to your existing Kubernetes environment, run the following command:
kubectl apply -f https://github.com/Altinity/clickhouse-operator/raw/0.20.3/deploy/operator/clickhouse-operator-install-bundle.yaml
Alternatively, to deploy your own version of the YAML file, download and modify the latest Altinity Kubernetes Operator YAML file and and run the deployment command:
kubectl apply -f clickhouse-operator-install-bundle.yaml
The following example response shows the result of a successful installation.
customresourcedefinition.apiextensions.k8s.io/clickhouseinstallations.clickhouse.altinity.com created customresourcedefinition.apiextensions.k8s.io/clickhouseinstallationtemplates.clickhouse.altinity.com created customresourcedefinition.apiextensions.k8s.io/clickhouseoperatorconfigurations.clickhouse.altinity.com created serviceaccount/clickhouse-operator created clusterrole.rbac.authorization.k8s.io/clickhouse-operator-kube-system created clusterrolebinding.rbac.authorization.k8s.io/clickhouse-operator-kube-system created configmap/etc-clickhouse-operator-files created configmap/etc-clickhouse-operator-confd-files created configmap/etc-clickhouse-operator-configd-files created configmap/etc-clickhouse-operator-templatesd-files created configmap/etc-clickhouse-operator-usersd-files created deployment.apps/clickhouse-operator created service/clickhouse-operator-metrics created
To verify that the installation was successful, run the following. On a successful installation, you’ll be able to see the
clickhouse-operator pod under the NAME column.
kubectl get pods --namespace kube-system
NAME READY STATUS RESTARTS AGE clickhouse-operator-857c69ffc6-dq2sz 2/2 Running 0 5s coredns-78fcd69978-nthp2 1/1 Running 4 (110s ago) 50d etcd-minikube 1/1 Running 4 (115s ago) 50d kube-apiserver-minikube 1/1 Running 4 (105s ago) 50d kube-controller-manager-minikube 1/1 Running 4 (115s ago) 50d kube-proxy-lsggn 1/1 Running 4 (115s ago) 50d kube-scheduler-minikube 1/1 Running 4 (105s ago) 50d storage-provisioner 1/1 Running 8 (115s ago) 50d
The following section provides more information on the resources created in the installation.
To customize Altinity Kubernetes Operator settings see:
Altinity recommends that you install a specific version of the ClickHouse-operator version that you know will work with your Kubernetes environment, rather than use the latest build from the GitHub master branch.
For details on installing other versions of the Altinity Kubernetes Operator see:
Deleting a deployment
This section covers how to delete a deployment.
Never delete the operator or run the following command while there are live ClickHouse clusters managed by the operator.
The command will hang due to the live clusters. If you then re-install the operator, those clusters will be deleted and the operator will not work correctly.
To delete a deployment using the latest clickhouse-operator YAML file:
kubectl delete -f https://raw.githubusercontent.com/Altinity/clickhouse-operator/master/deploy/operator/clickhouse-operator-install-bundle.yaml
To delete a deployment using your local clickhouse-operator YAML file:
kubectl delete -f clickhouse-operator-install-bundle.yaml