Skip to content

feat(clickhouse): k8s ClickHouse modules (operator, keeper, cluster)#375

Open
anshulsao wants to merge 1 commit into
mainfrom
feat/clickhouse-k8s-modules
Open

feat(clickhouse): k8s ClickHouse modules (operator, keeper, cluster)#375
anshulsao wants to merge 1 commit into
mainfrom
feat/clickhouse-k8s-modules

Conversation

@anshulsao

Copy link
Copy Markdown
Contributor

What

Adds three Altinity-operator-based modules to deploy ClickHouse on Kubernetes, plus their @facets output types:

Module Output type Role
clickhouse_operator/k8s/1.0 @facets/clickhouse-operator Installs the Altinity operator (CHI/CHK CRDs) via helm
clickhouse_keeper/k8s/1.0 @facets/clickhouse-keeper ClickHouse Keeper ensemble (ZooKeeper replacement)
clickhouse/k8s/1.0 @facets/clickhouse A ClickHouse cluster (ClickHouseInstallation)

All three take kubernetes_details: @facets/kubernetes-details (k8s + helm providers). Keeper/CHI depend on the operator input for CRD ordering; CHI wires its ZooKeeper host from the keeper output.

Design notes (learned the hard way during the eu-prod pilot)

  • CRDs via LOCAL helm charts (chart = "${path.module}/chart") to dodge the kubernetes_manifest plan-time CRD schema check.
  • Dedicated node-pool pinning — optional node_pool: @facets/kubernetes_nodepool input on all three. Renders nodeSelector via the always-present cloud.google.com/gke-nodepool=<name> label + tolerations. GKE reports the taint effect as NO_SCHEDULE; normalised to k8s NoSchedule (k8s rejects the GKE form).
  • Altinity podTemplate contractspec.defaults.templates.podTemplate reference + dataVolumeClaimTemplate, and podDistribution as a child of the podTemplate (not under configuration.clusters[].templates). Without this the operator ignores placement and never creates the StatefulSet.
  • Configurable cluster_domain (default cluster.local) → renders the CHI/CHK namespaceDomainPattern and the keeper service_host FQDN. Required on clusters whose k8s DNS domain isn't cluster.local. Facets-provisioned GKE clusters use the environment name as the DNS domain (e.g. eu-prod), so without this override the operator queries ...svc.cluster.local → NXDOMAIN → marks every replica "NOT alive" → CHI stuck InProgress forever.

Verification

Deployed end-to-end in a live Facets GKE env (SaaS Labs eu-prod), cluster_domain=eu-prod:

  • CHI (apiv2, 1 shard × 3 replicas) → Completed, all 3 pods Running
  • CHK (ch-keeper, 3-node ensemble) → Completed
  • Operator 2/2 Running; every pod scheduled on the dedicated ClickHouse node pool; replicas anti-affinity-spread across nodes/zones.

Follow-ups (not in this PR)

  • icons/clickhouse*.svg — left out to avoid committing a trademarked logo; happy to add cloud-neutral icons if preferred.
  • Project-type mapping / catalog entry, if the repo expects it for new intents.

🤖 Generated with Claude Code

Add three Altinity-operator-based modules to deploy ClickHouse on
Kubernetes, plus their @facets output types:
- clickhouse_operator/k8s/1.0 -> @facets/clickhouse-operator
- clickhouse_keeper/k8s/1.0   -> @facets/clickhouse-keeper
- clickhouse/k8s/1.0          -> @facets/clickhouse

Design notes:
- CHI/CHK CRDs rendered via LOCAL helm charts to dodge the
  kubernetes_manifest plan-time CRD schema check.
- Optional node_pool input pins every component to a dedicated pool:
  nodeSelector via cloud.google.com/gke-nodepool + tolerations. GKE
  reports the taint effect as NO_SCHEDULE; normalised to k8s NoSchedule.
- Altinity podTemplate contract honoured: defaults.templates.podTemplate
  reference + podDistribution as a podTemplate child (else the operator
  ignores placement / never creates the StatefulSet).
- Configurable cluster_domain (default cluster.local) renders the CHI/CHK
  namespaceDomainPattern and the keeper service_host FQDN. Required on
  clusters whose k8s DNS domain is not cluster.local (Facets GKE clusters
  use the environment name, e.g. eu-prod) or the operator can't resolve
  replica hosts and the CHI deadlocks InProgress.

Verified end-to-end: apiv2 pilot reached CHI + CHK Completed with all 3
replicas Running on the dedicated ClickHouse node pool.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RsiV1JkMqt96ZQb1brv4zq
@anshulsao
anshulsao marked this pull request as ready for review July 15, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant