Installation
Introduction
This page provides instructions to deploy the Altinity Kubernetes Operator for ClickHouse® to your Kubernetes environment.
Prerequisites
The following items are required:
- Kubernetes version 1.15.11 or later
- Kubernetes Install Tools -
kubectl
is required. - clickhouse-operator-install-bundle.yaml - this is the latest (master branch) of the operator deployment YAML file
For Other Altinity deployment YAML file versions
To find other versions of the deployment YAML file, visit the file in our GitHub repo and select another branch from the GitHub branch menu.
Deployment Instructions
This example shows how to deploy version 0.23.5 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.
Installation Commands
To install version 0.23.5 of the Altinity Kubernetes Operator for ClickHouse to your existing Kubernetes environment, run the following command:
> kubectl apply -f https://raw.githubusercontent.com/Altinity/clickhouse-operator/release-0.23.5/deploy/operator/clickhouse-operator-install-bundle-v1beta1.yaml
The URL will be different if you’re using another version of the file.
Alternatively, to deploy your own version of the YAML file, download the latest Altinity Kubernetes Operator YAML file and run the following command:
> kubectl apply -f clickhouse-operator-install-bundle.yaml
Successful Installation
If everything worked, you should see something like this:
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
Installation Verification
To verify that the installation was successful, run the following command. If the operator installed successfully, you’ll see clickhouse-operator
in the output:
> kubectl get deployment.apps -n kube-system
NAME READY UP-TO-DATE AVAILABLE AGE
clickhouse-operator 1/1 1 1 80s
coredns 1/1 1 1 102d
The Operator Resources Details section has more information on the resources created in the installation.
Customization options
To customize Altinity Kubernetes Operator settings see the Operator Guide.
Altinity recommends that you install a specific version of the ClickHouse operator 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 the Specific Version Installation Guide
Deleting a deployment
This section covers how to delete a deployment.
IMPORTANT
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 the operator, run kubectl delete
with the URL or filename you used when you installed it:
> kubectl delete -f https://raw.githubusercontent.com/Altinity/clickhouse-operator/master/deploy/operator/clickhouse-operator-install-bundle.yaml
If you downloaded the file to your machine first, simply use this:
> kubectl delete -f clickhouse-operator-install-bundle.yaml
What’s next
Well, we’ve covered installing the Altinity ClickHouse operator. Obviously you’ll want to actually do something with it now. Next we’ll look at creating your first ClickHouse cluster inside your Kubernetes cluster. Read on…