Deploying ClickHouse Via kubekanvas (a fast open-source column-oriented database management system that allows generating analytical data reports in real-time using SQL queries)
Follow these steps in order to replicate the environment or recover from a cluster reset.
- Install NGINX Ingress Controller:
This command builds the "bridge" between your physical machine and the Kubernetes cluster.
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/cloud/deploy.yaml - Verify Ingress Controller Readiness:
Wait until the status shows
Running.
kubectl get pods -n ingress-nginx - Watch the Startup Sequence:
Monitor the pods until both
keeper-0andclickhouse-0show1/1 READY.kubectl get pods -n clickhouse -w
Local Networking Configuration
Since you are using Docker Desktop, your computer needs to be told that clickhouse.local is actually your own machine.
- Update Windows Hosts File:
- Open Notepad as Administrator.
- Open
C:\Windows\System32\drivers\etc\hosts. - Append the following line and save:
127.0.0.1 clickhouse.local
Data Verification (The Smoke Test)
With the network path established, we execute the first SQL commands via the Ingress.
- Create Schema and Insert Data: This command tests the Write Path: Ingress Service ClickHouse Pod Disk.
curl -X POST http://clickhouse.local --data-binary "
CREATE DATABASE IF NOT EXISTS demo;
CREATE TABLE IF NOT EXISTS demo.events (id UInt32, message String) ENGINE = MergeTree() ORDER BY id;
INSERT INTO demo.events VALUES (1, 'clickhouse on kubernetes works');"
- Query the Data: This command tests the Read Path and verifies data persistence.
curl http://clickhouse.local --data-binary "SELECT * FROM demo.events;"
Dashboard Access
- Open the Web UI:
Navigate to
http://clickhouse.local/dashboardin your browser.
- User:
default - Password: (Leave Blank)
Summary of Components Created
| Command Target | Role |
|---|---|
| Namespace | Logical isolation for ClickHouse resources. |
| ConfigMap | Overrides config.xml (Cluster/Zookeeper) and users.xml (Auth). |
| StatefulSet (Keeper) | 1-node coordination engine for metadata. |
| StatefulSet (Server) | 1-node database engine with 10Gi Persistent Storage. |
| Ingress | Routes clickhouse.local traffic to the database service. |
