This guide covers installing the ClickHouse Operator using kubectl and manifest files.
Prerequisites
- Kubernetes cluster v1.28.0 or later
- kubectl v1.28.0 or later
- Cluster admin permissions
Install from Release Manifests
Install the operator and CRDs from the latest release:
kubectl apply --server-side --force-conflicts -f https://github.com/ClickHouse/clickhouse-operator/releases/latest/download/clickhouse-operator.yamlServer-side apply is required because the combined CRDs exceed the client-side apply size limit. For environments that only support client-side apply, use the description-stripped CRD variant:
kubectl apply -f https://github.com/ClickHouse/clickhouse-operator/releases/latest/download/clickhouse-operator-stripped-crds.yamlThis will:
- Create the
clickhouse-operator-systemnamespace - Install CustomResourceDefinitions (CRDs) for ClickHouseCluster and KeeperCluster
- Create necessary ServiceAccounts, Roles, and RoleBindings
- Deploy the operator controller manager
- Register webhooks for resource validation and defaulting
- Configure SSL certificates using cert-manager
- Enable metrics endpoint
Verify Installation
Check that the operator is running:
kubectl get pods -n clickhouse-operator-systemExpected output:
NAME READY STATUS RESTARTS AGE
clickhouse-operator-controller-manager-xxxxxxxxxx 1/1 Running 0 1mVerify the CRDs are installed:
kubectl get crd | grep clickhouse.comExpected output:
clickhouseclusters.clickhouse.com 2025-01-06T00:00:00Z
keeperclusters.clickhouse.com 2025-01-06T00:00:00ZConfigure Custom Deployment Options
If you want to configure operator deployment options, follow the steps below.
Clone the Repository
git clone https://github.com/ClickHouse/clickhouse-operator.git
cd clickhouse-operatorConfigure installation options
Edit config/default/kustomization.yaml to enable/disable features as needed.
- To disable webhooks, comment out the
[WEBHOOK]and[CERTMANAGER]sections. - To enable secure metrics endpoint, comment out
[METRICS]sections and uncomment[METRICS SECURE]and[CERTMANAGER]sections. - To enable ServiceMonitor for Prometheus Operator, uncomment the
[PROMETHEUS]section. - To enable operator network policies, uncomment the
[NETWORK POLICY]section.
Build and Deploy
Build the operator manifests and apply them:
make build-installer VERSION=<required operator version> [IMG=<custom registry path>]
kubectl apply --server-side --force-conflicts -f dist/install.yaml