It also includes steps to test data persistence and connectivity to ensure your deployment is reliable.
Prerequisites
Before starting, ensure the following tools and components are installed:| Requirement | Description |
|---|---|
| Kubernetes cluster | Any K8s distribution (GKE, EKS, DigitalOcean, Minikube, etc.) |
| kubectl | CLI tool to interact with your cluster |
| Helm 3+ | To install the ClickHouse Operator |
| StorageClass | Persistent volume provisioner (e.g., do-block-storage on DigitalOcean or gp3-encrypted on AWS) |
| Namespace | Recommended: infra or clickhouse |
Step 1: Install ClickHouse Operator
The Altinity ClickHouse Operator manages ClickHouse clusters declaratively via CRDs (Custom Resource Definitions).Install via Helm
Step 2: Create ClickHouse Cluster
Create ClickHouse Cluster
Create a file named
clickhouse-cluster.yaml with the following content:clickhouse-cluster.yaml
Step 3: Verify ClickHouse Cluster Health
Run the following command:Step 4: Connect to ClickHouse
- Option 1: Using kubectl port-forward
- Option 2: Using clickhouse-client
Step 5: Test Persistence
To verify that your data persists across pod restarts: ✅ If you still see all inserted rows — persistence is working properly.Step 6: Cleanup or Reinstall
If you need to reinstall or reset everything:Step 7: Common Testing Commands
| Purpose | Command |
|---|---|
| List databases | kubectl exec -it chi-suprsend-ch-0-0-0 -n clickhouse -- clickhouse-client -q "SHOW DATABASES" |
| Check system tables | kubectl exec -it chi-suprsend-ch-0-0-0 -n clickhouse -- clickhouse-client -q "SELECT name, engine FROM system.tables WHERE database='test'" |
| View pod logs | kubectl logs chi-suprsend-ch-0-0-0 -n clickhouse |
| Describe volumes | kubectl describe pvc -n clickhouse |
Step 8: SuprSend Helm Configuration
Once your ClickHouse cluster is set up and running, configure SuprSend to connect to it.This section shows only the ClickHouse-specific configuration. You must also configure other required secrets and values for SuprSend to work properly. See the complete configuration guide: SuprSend Installation Guide
Kubernetes Secret Configuration
First, add the ClickHouse-specific secrets to yoursuprsend-secrets.yaml:
Helm Values Configuration
Then add the following to yoursuprsend-values.yaml (along with other required configuration):
The above configuration goes under
global.config section in your suprsend-values.yaml.Summary
You now have a fully functional ClickHouse cluster running inside Kubernetes with:- Persistent 200Gi storage per pod
- 1 shard × 1 replica layout (easy to scale later)
- Verified persistence across restarts
- Easy connectivity via
clickhouse-clientor HTTP API - SuprSend Helm configuration ready
👉 Altinity ClickHouse Operator Documentation
FAQ
Pods stuck in Pending
Pods stuck in Pending
Possible cause: StorageClass not found.Fix: Check that
storageClassName matches your cluster’s available storage classes.Pod restarting repeatedly
Pod restarting repeatedly
Possible cause: Wrong image or insufficient resources.Fix: Check logs with
kubectl logs and verify resource limits are adequate.Can't connect via port-forward
Can't connect via port-forward
Possible cause: ClickHouse not yet ready.Fix: Wait until the log shows “Ready for connections” before attempting to connect.
Data lost after restart
Data lost after restart
Possible cause: PVC deleted or reclaim policy not set.Fix: Ensure
reclaimPolicy: Retain is set on your StorageClass.