How to install the Altinity ClickHouse-Operator to your Kubernetes environment

How to install and verify the Altinity Kubernetes Operator

28 July 2023 · Read time 4 min

Introduction - Altinity ClickHouse-Operator

This page provides instructions to deploy the Altinity Kubernetes Operator to your Kubernetes environment.

Prerequisites

The following items are required:


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.21.2 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 a version 0.21.2 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.21.2/deploy/operator/clickhouse-operator-install-bundle.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 and modify the latest Altinity Kubernetes Operator YAML file and run the following command:

kubectl apply -f clickhouse-operator-install-bundle.yaml

Successful Installation

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

Installation Verification

To verify that the installation was successful, run the following command:

kubectl get deployment.apps -n kube-system

If the operator installed successfully, you’ll see clickhouse-operator in the output:

NAME                  READY   UP-TO-DATE   AVAILABLE   AGE
clickhouse-operator   1/1     1            1           80s
coredns               1/1     1            1           102d

More Information The following section provides more information on the resources created in the installation.

Customization options

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.

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