Free audit

View Audit Scope
ClickHouse on K8sAltinity Operator, Keeper HA, NVMe + S3 & clickhouse-backup

ClickHouse on Kubernetes: Altinity Operator & Keeper HA

JusDB deploys and operates production ClickHouse on Kubernetes across Amazon EKS, Google GKE, Azure AKS, OpenShift, and bare-metal clusters. Database engineers configure the Altinity ClickHouse Operator (ClickHouseInstallation and ClickHouseKeeperInstallation CRDs), isolate 3-node ClickHouse Keeper Raft quorums across availability zones, wire local NVMe and S3 tiered storage, and automate clickhouse-backup and rolling upgrades under your service agreement.

The first 30-minute call covers your databases, current ownership, and required coverage. No production access is needed. Or request a free audit of one database instance.

  • NDA before access
  • GitOps-ready CHI/CHK CRDs
  • Written scope before work starts

ClickHouse Kubernetes architecture

Select a Kubernetes component

ClickHouseInstallation (CHI) & ClickHouseKeeperInstallation (CHK)

CHI + CHK CRDs

Declarative shard-and-replica StatefulSet generation, automatic remote_servers and macros XML rendering, and sequential rolling upgrades that restart one replica at a time.

Inspect K8s operator states

Aligned with the Altinity ClickHouse Operator and ClickHouse Keeper specifications.

Kubernetes platforms
Amazon EKS, Google GKE, Azure AKS, Red Hat OpenShift, and bare-metal Kubernetes with local NVMe CSI
Initial-response targets
15 minutes for a critical (P1) incident under a 24x7 support agreement; 2 to 4 hours in business hours. See details
Coverage hours
Business hours (03:30–12:30 UTC) by default; 24x7 on-call available under a 24x7 support agreement

Selected clients

  • Innoviti
  • Blitz
  • Freecharge
  • Nango
  • Recochain
  • Screen Facts
  • Nexora
  • WeCredit

When teams call us

Common ClickHouse on Kubernetes failures we fix

We resolve container Exit Code 137 OOMKills, ClickHouse Keeper quorum drops during node drains, embedded Keeper CPU contention, EBS merge throttling, and hung ON CLUSTER DDL queues.

Common ClickHouse on Kubernetes symptoms and how JusDB engineers resolve them
SymptomWhat is usually happeningWhere we start
K8S_OOMKILLED_137ClickHouse server pod killed by kubelet with Exit Code 137max_server_memory_usage_to_ram_ratio defaults to 0.90, leaving insufficient room inside the container cgroup for OS page cache, jemalloc fragmentation, and background merges.Set Guaranteed QoS (requests == limits), lower max_server_memory_usage_to_ram_ratio to 0.75-0.80, and bound mark_cache_size and uncompressed_cache_size.
KEEPER_QUORUM_EVICTIONCluster nodes drop into read-only mode during EKS/GKE node upgradesClickHouse Keeper pods lack a PodDisruptionBudget or zone anti-affinity, allowing Karpenter or cluster autoscaler to drain 2 of 3 Keeper pods at once.Deploy ClickHouseKeeperInstallation on dedicated 3-AZ node pools with PodDisruptionBudget (maxUnavailable: 1) and separate NVMe PVCs for raft_log.
EMBEDDED_KEEPER_CONTENTIONKeeper session timeouts spike whenever heavy analytical queries runClickHouse Keeper is embedded inside the main clickhouse-server process, sharing CPU threads, memory, and disk IOPS with heavy MergeTree scans and merges.Decouple ClickHouse Keeper into standalone ClickHouseKeeperInstallation pods with isolated CPU, memory, and dedicated disk volumes.
EBS_GP3_MERGE_THROTTLEPart merges stall and replication queue grows to thousands of entriesDefault 3,000-IOPS / 125-MB/s EBS GP3 volumes saturate throughput when merging multi-gigabyte parts alongside continuous ingest.Provision higher GP3 throughput (500-1,000 MB/s) or local NVMe CSI volumes for hot data, and configure S3 tiered storage for cold partitions.
SHARD_SCALE_DATA_SKEWAdding a new shard via CHI CRD leaves 100% of historical data on old shardsThe Operator creates the new shard's StatefulSet and updates remote_servers, but ClickHouse does not automatically rebalance existing historical partitions.Adjust internal_replication shard weights for new writes or use clickhouse-backup / FETCH PARTITION from S3 to rebalance hot tables.
ON_CLUSTER_DDL_HANGALTER TABLE ... ON CLUSTER hangs indefinitely after a pod restartStale pod hostname entries or unacknowledged tasks in system.distributed_ddl_queue block schema migrations across the CHI cluster.Inspect system.distributed_ddl_queue and Keeper /clickhouse/task_queue/ddl znodes, clear orphaned entries, and standardize StatefulSet FQDN macros.

Response targets and escalation

How fast does JusDB respond to a ClickHouse Kubernetes incident?

Initial-response targets are 2 to 4 hours during covered business hours, Mon–Fri 09:00–18:00 IST (UTC+5:30). Where your service agreement includes 24x7 on-call, the initial-response target for P1 incidents is 15 minutes. Targets are not resolution guarantees. Standard business hours run 03:30–12:30 UTC.

Published initial-response targets by severity

  • 2 to 4 hours

    Business hours

    During covered business hours

  • 15 minutes

    24x7 on-call

    P1 incidents

SeverityInitial responseDefinitionChannel & coverage
P1 · Critical15 minutesProduction database down, primary unreachable, data corruption risk, or active failover event.24x7 on-call (under your service agreement) · Direct PagerDuty, Opsgenie, or phone page plus incident bridge
P2 · High30 minutesSevere latency spike, replication lag climbing rapidly, connection exhaustion, or degraded HA node.24x7 on-call (under your service agreement) · On-call alert plus shared Slack or Teams channel
P3 · Medium60 minutesNon-critical slow query regression, staging issue, backup warning, or replication check alert.24x7 on-call (under your service agreement) · Shared Slack or Teams channel or support ticket
P4 · Low90 minutesConfiguration question, index advisory, planned schema review, or general operational request.24x7 on-call (under your service agreement) · Shared Slack or Teams channel or support ticket

Our engineering team is in India; business-hours coverage is Mon–Fri 09:00–18:00 IST (UTC+5:30), and 24x7 on-call is available under your service agreement.

Initial-response targets, not resolution guarantees. The target for your engagement is set in your service agreement.

What happens when a P1 Kubernetes incident pages

  1. Page

    Direct alert to the on-call ClickHouse & Kubernetes engineer

    No tier-1 queue; immediate triage under your service agreement.

  2. Inspect

    Read-only CHI/CHK pod, PVC, Keeper, and system.* diagnostics

    Correlate kubelet OOMKills, Keeper quorum logs, and system.replicas.

  3. Stabilize

    Restore Keeper quorum, clear read-only states, and cap memory

    Run SYSTEM RESTORE REPLICA or clear stuck distributed DDL tasks.

  4. Harden

    Written post-incident review and CHI/CHK CRD manifest PR

    Permanent cgroup, PDB, and storage fixes committed to your GitOps repo.

Scope of Kubernetes engineering

What does ClickHouse on Kubernetes consulting & operations cover?

We deliver hardened Altinity Operator CRDs, standalone ClickHouse Keeper quorums, hybrid NVMe + S3 storage policies, automated clickhouse-backup pipelines, and day-2 SRE support.

  • Altinity Operator (CHI & CHK) architecture

    We author production-hardened ClickHouseInstallation and ClickHouseKeeperInstallation CRDs managed through Helm, Kustomize, or ArgoCD.

    • Automated <remote_servers>, <macros>, and ReplicatedMergeTree topology generation
    • PodTemplates with Guaranteed QoS, zone anti-affinity, and PodDisruptionBudgets

    Altinity Operator · CHI CRD · CHK CRD · Helm / ArgoCD

    Explore ClickHouse consulting
  • Standalone ClickHouse Keeper Raft quorums

    Isolate Raft coordination from query and merge workloads so Keeper heartbeats remain sub-millisecond even under 100% CPU query spikes.

    • 3-node or 5-node ClickHouseKeeperInstallation spread across 3 availability zones
    • Dedicated low-latency PVC for coordination logs and snapshots

    ClickHouseKeeperInstallation · NuRaft · 4LW Metrics · PDB

    ClickHouse architecture guide
  • NVMe + S3 tiered storage on Kubernetes

    Combine fast local NVMe or high-throughput EBS/PD-SSD PVCs for hot parts with credential-free S3/GCS object storage for cold retention.

    • Storage policies with automatic TTL partition movement to S3 or GCS
    • AWS IRSA / EKS Pod Identity and GKE Workload Identity integration

    StorageClass · Local NVMe CSI · S3 Disk · IRSA / Workload Identity

  • Automated S3 backups with clickhouse-backup

    Run sidecar or CronJob incremental backups to S3/GCS using hardlinks and shadow directories with scheduled restore verification.

    • Full + incremental diff backups via Altinity clickhouse-backup sidecar
    • Automated restore-to-staging drills to verify RPO and RTO compliance

    clickhouse-backup · S3 / GCS · Shadow Hardlinks · Restore Drills

    ClickHouse MergeTree storage and query optimization guide
  • Cgroup v2 memory tuning & observability

    Eliminate Exit Code 137 OOMKills and wire native ClickHouse Prometheus metrics and query-log dashboards into your observability stack.

    • Calibration of max_server_memory_usage_to_ram_ratio, mark_cache, and page cache
    • Prometheus ServiceMonitor scraping port 9363 and pre-built Grafana dashboards

    Cgroup v2 · ServiceMonitor · Prometheus · Grafana

    Explore ClickHouse performance tuning
  • Shard expansion & rolling LTS upgrades

    Scale shards horizontally and execute rolling upgrades between ClickHouse LTS tracks (e.g., 24.3 LTS to 24.8 LTS) without dropping queries.

    • Replica-by-replica rolling restarts gated by replication queue readiness
    • Shard weight rebalancing and zero-copy partition migration

    CHI Rolling Upgrade · Shard Weights · FETCH PARTITION

    Explore ClickHouse migration services

Operator orchestration and written evidence

How the Altinity Operator manages shards and Keeper

Explore how ClickHouseInstallation (CHI) and ClickHouseKeeperInstallation (CHK) custom resources coordinate multi-AZ high availability, rolling LTS upgrades, and online shard expansion.

Altinity ClickHouse Operator operational states

Select an operational state to inspect pod topology, Keeper sync, and routing.

Service and replication path

Client Service -> CHI Replica Pods -> Local NVMe + S3 Tier -> Keeper Raft sync

Production K8s layout
  • ClickHouseKeeperInstallation

    chk-prod-0..2 (3 AZs, dedicated raft_log PVC)

    Quorum healthy; isolated from query CPU

  • ClickHouseInstallation (Shards)

    chi-prod-s1-r0..1, chi-prod-s2-r0..1

    Guaranteed QoS + NVMe hot / S3 cold volumes

  • Backup Sidecar

    clickhouse-backup container per shard

    Incremental hardlink snapshots to S3

A 3-pod ClickHouseKeeperInstallation (CHK) runs on dedicated nodes across 3 AZs, coordinating a multi-shard ClickHouseInstallation (CHI) where each shard has 2 ReplicatedMergeTree replicas.

Example written finding from a GKE ClickHouse OOMKilled & Keeper auditSample deliverable

Finding

Embedded Keeper timeouts and 90% RAM ratio cause cascading read-only locks

ClickHouse Keeper was running embedded inside 32 GiB clickhouse-server pods with max_server_memory_usage_to_ram_ratio = 0.9. Heavy hourly merges triggered kubelet Exit Code 137 on one pod and starved Keeper Raft heartbeats on another. Extracting Keeper to a standalone 3-pod CHK and capping server RAM at 78% eliminated all outages.

Pod OOMKills / month19 → 0
Keeper p99 latency420ms → 1.8ms

1. Read-only check of replica read-only flags & Keeper exceptions

SELECT database, table, is_readonly, is_session_expired,
       zookeeper_exception, absolute_delay
FROM system.replicas
WHERE is_readonly = 1 OR is_session_expired = 1;

2. Hardened CHI memory configuration for Kubernetes cgroups

spec:
  configuration:
    settings:
      max_server_memory_usage_to_ram_ratio: "0.78"
      mark_cache_size: "4294967296"
      uncompressed_cache_size: "2147483648"
    zookeeper:
      nodes:
        - host: chk-prod-keeper.clickhouse.svc.cluster.local
          port: 2181

Your team and ours

How responsibilities divide for ClickHouse on Kubernetes

Managed cloud databases automate much of the infrastructure layer, but your team still owns query performance, capacity, cost, and incident decisions.

Shared responsibility for ClickHouse on Kubernetes versus ClickHouse Cloud
AreaClickHouse Cloud SaaSYour own EKS, GKE, AKS, or OpenShift with JusDB
Altinity Operator (CHI / CHK) CRDs and StatefulSet topologyClickHouse Cloud hides Kubernetes orchestration behind a proprietary control plane.JusDB authors and maintains your CHI and CHK manifests, macros, and PodDisruptionBudgets in Git.
Cgroup v2 memory ratios and Exit Code 137 OOMKill preventionCloud replicas still restart if unoptimized queries exceed warehouse RAM.JusDB calibrates max_server_memory_usage_to_ram_ratio, mark cache, and Guaranteed QoS pod limits.
Standalone ClickHouse Keeper quorum and disk isolationManaged internally by the cloud vendor.JusDB deploys dedicated 3-AZ Keeper StatefulSets with isolated NVMe/SSD raft_log volumes.
NVMe + S3 tiered storage policies and IRSA bindingsCloud uses a single object-storage tier billed at vendor storage rates.JusDB configures hybrid local NVMe + S3 storage policies in your own AWS/GCP/Azure account.
clickhouse-backup automation and rolling LTS upgradesBackups and version upgrades follow vendor schedules and retention limits.JusDB wires clickhouse-backup S3 schedules, runs restore drills, and executes rolling LTS upgrades.

Your team keeps control

  • Set business priorities, application requirements, and release plans
  • Approve production changes, except routine actions you have pre-approved
  • Own your cloud accounts, access policies, and vendor relationships
  • Decide when maintenance can happen and how quickly service must recover
  • Move the work in-house or to another provider after your agreement's notice period, with your data returned or deleted and the transition help your agreement sets out (Terms, section 8)

JusDB handles the agreed Kubernetes & DB work

  • Monitor database health, investigate alerts, and involve the right people
  • Review query performance, replication, capacity, and backup health
  • Carry out approved changes and update the operating instructions they affect
  • Report completed work, open risks, and recommended next steps

Supported Kubernetes platforms

Compare options

How JusDB ClickHouse on Kubernetes compares with SaaS and DIY Helm

Run ClickHouse inside your own cloud VPC on Reserved/Spot NVMe instances and S3 without paying SaaS compute markups or risking unguarded DIY StatefulSets.

Evaluation Vector
JusDB DBRE
In-House DBALegacy AgencyDeveloper Generalist
Operator Selection (Altinity vs Official vs Helm)Production Altinity ClickHouse Operator architecture with customized ClickHouseInstallation CRDs, multi-cluster templates, automated schema synchronization, and battle-tested lifecycle controllers.Generic community Helm chart deployments without operator reconciliation, requiring manual pod interventions during schema or topology mutations.Naked StatefulSet manifests lacking ClickHouse lifecycle awareness, causing configuration drift and broken shard definitions across environments.Monolithic container deployments on standalone pods without Kubernetes CRD abstractions or horizontal scaling controllers.
Multi-Pod ClickHouse Keeper Raft ConsensusDedicated 3-pod or 5-pod Keeper StatefulSet deployed with strict pod anti-affinity, isolated local NVMe storage, and tuned raft log compaction to eliminate election deadlocks.Keeper co-located on analytical compute worker pods; heavy analytical queries starve Keeper CPU and trigger false quorum loss failovers.External legacy ZooKeeper deployment with heavy JVM memory footprints and uncontrolled GC pauses freezing cluster coordination.Single Keeper replica without quorum redundancy; any single node restart halts all distributed DDL queries cluster-wide.
Local NVMe vs EBS Volume Topology & S3 TieringHybrid multi-tier storage policies combining high-IOPS local NVMe for hot partitions with automated background TTL offloading to Amazon S3 or Google Cloud Storage.Standard EBS gp3 volumes without tiering, resulting in runaway cloud storage costs and I/O credit throttling during analytical queries.Network-attached NFS or shared block volumes causing severe latency spikes and ClickHouse part locking corruptions.Ephemeral hostPath storage without proper volume snapshots; node eviction permanently deletes active table parts.
Rolling Stateful UpgradesReplicated table-aware rolling upgrade sequence (replica-by-replica), active query drain verification before each restart, and system.replicas sync validation.Mass StatefulSet rolling restart that drops active analytical client queries and triggers concurrent replica resync network storms.Full maintenance window cluster stops, incurring hours of analytical application outage during version upgrades.Direct image tag updates in deployment manifests causing uncoordinated restarts, split-brain states, and corrupted table parts.
PodDisruptionBudget & Node Drain ResilienceGranular PodDisruptionBudgets enforcing maxUnavailable=1 per shard, graceful preStop lifecycle hooks, and automated cordon/drain safety gates during Kubernetes node upgrades.Unrestricted node drains killing multiple replicas in the same shard concurrently, causing instantaneous analytical downtime.Missing PDBs; automated Kubernetes cluster autoscaler node consolidations repeatedly terminate active ClickHouse merge threads.No preStop hooks or termination grace period tuning; abrupt SIGKILL signals corrupt uncommitted part writes.
Cloud-Native Telemetry (Prometheus / Grafana)Native Prometheus endpoint integration, custom Grafana dashboards for parts merging, replication queue lag, Keeper raft health, and Alertmanager alerts with automated runbooks.Standard Kubernetes node-exporter without internal ClickHouse system table scraping, missing critical replication lag anomalies.Generic third-party APM agents injected into containers, introducing CPU overhead without ClickHouse-specific query telemetry.No metrics collection; relies on application HTTP 500 error logs to discover when ClickHouse pods run out of memory.

For procurement and security

NDA first, GitOps-native delivery, and written scope

All ClickHouseInstallation and ClickHouseKeeperInstallation CRDs, backup schedules, and alert rules are delivered as pull requests to your Git repository.Raguraman, Head of DBSRE · Allen D, Principal Engineer
  • Mutual NDA
  • Written statement of work
  • Named engineers
  • Least-privilege RBAC
  • NDA before access

    Signed before any Kubernetes or ClickHouse inspection.

  • Written agreement

    Namespace scope, SLO targets, and deliverables defined in writing.

  • Namespace-scoped RBAC

    Read-only kubectl and SQL access by default through your bastion or VPN.

  • Manifests you keep

    Every CHI/CHK manifest, backup policy, and upgrade runbook stays in your repository. Meet the JusDB team.

JusDB's security practices are aligned with ISO 27001 and SOC 2 Type II, and JusDB is pursuing both certifications (see Terms, section 12). Read the stated status.

FAQ

Common ClickHouse on Kubernetes questions

Answers on the Altinity ClickHouse Operator, Exit Code 137 OOMKills, standalone ClickHouse Keeper pods, NVMe + S3 storage, and clickhouse-backup.

Still have a question?

Ask it on a scoping call. No production access needed.

Book a 30-min scoping call (opens Google Calendar in a new tab)

Should we use the Altinity ClickHouse Operator to run ClickHouse on Kubernetes?

Yes. The open-source Altinity ClickHouse Operator is the industry standard for running ClickHouse on Kubernetes. Its ClickHouseInstallation (CHI) and ClickHouseKeeperInstallation (CHK) custom resources automate StatefulSet creation, XML configuration generation (<remote_servers>, <macros>, <zookeeper>), schema propagation across new shards, and replica-by-replica rolling upgrades.

Why do ClickHouse pods get OOMKilled (Exit Code 137) on Kubernetes?

ClickHouse's internal memory tracker defaults to allowing 90% of host RAM (max_server_memory_usage_to_ram_ratio = 0.9), and on older releases or misconfigured cgroup mounts it may read the physical node's RAM instead of the container limit. When OS page cache, uncompressed cache, mark cache, and jemalloc overhead are added, the container exceeds its Kubernetes memory limit. We set Guaranteed QoS, cap max_server_memory_usage_to_ram_ratio to 0.75-0.80, and size mark_cache_size explicitly.

Should ClickHouse Keeper run inside ClickHouse server pods or as separate pods?

In production, always run ClickHouse Keeper as separate pods (using ClickHouseKeeperInstallation) on dedicated CPU and disk resources. Embedding Keeper inside clickhouse-server pods means a heavy MergeTree merge or analytical query spike can starve Keeper Raft heartbeats and drop tables into read-only mode.

What storage class should we use for ClickHouse on EKS, GKE, or AKS?

For low-latency hot data and Keeper raft logs, we use local NVMe SSDs (via local-volume CSI on i3en/i4i or GKE Local SSD) or high-throughput EBS GP3 / io2 / PD-SSD PersistentVolumeClaims, paired with an S3 or GCS disk tier for cold partitions older than 7-14 days.

How do backups work for ClickHouse on Kubernetes?

We deploy Altinity clickhouse-backup as a sidecar container inside each ClickHouse pod (or via Operator backup templates). It creates instant local shadow snapshots using filesystem hardlinks and uploads compressed incremental part diffs directly to S3, GCS, or Azure Blob Storage using IAM Workload Identity.

Can we scale ClickHouse shards horizontally with the Kubernetes HorizontalPodAutoscaler (HPA)?

Stateful ClickHouse shards should not be scaled up and down every few minutes with a naive CPU HPA because stateful shards hold local partition data. Instead, we scale stateless replicas or add shards declaratively through the ClickHouseInstallation CRD with controlled shard-weight balancing.

How fast does JusDB respond to a P1 ClickHouse Kubernetes incident?

Initial-response targets are 2 to 4 hours during covered business hours, Mon–Fri 09:00–18:00 IST (UTC+5:30). Where your service agreement includes 24x7 on-call, the initial-response target for P1 incidents is 15 minutes. Targets are not resolution guarantees.

How do we get started with a ClickHouse Kubernetes review or deployment?

We start with a 30-minute scoping call, sign a mutual NDA, and perform a read-only audit of your CHI/CHK manifests, PVC IOPS, cgroup settings, and system.* tables. You receive a written engineering report and statement of work before any changes are applied.

ClickHouse playbooks and guides

ClickHouse Keeper, S3 backup, and Kubernetes engineering guides

Operational guides from our engineering blog and related ClickHouse service pages.

Next step

Talk to a ClickHouse engineer about your Kubernetes cluster

Tell us which Kubernetes platform and storage classes you run and what stability or scaling goals you want covered. The first 30-minute call covers your databases, current ownership, and required coverage. No production access is needed. Or request a free audit of one database instance, subject to availability: mutual NDA before read-only access, a prioritized report within one week after access is ready, and no obligation.

NDA before access · read-only by default · written scope first

Related ClickHouse Services

Explore more ways our ClickHouse experts can help with your database infrastructure.