KubeBlocks
BlogsEnterprise
⌘K
​
Blogs
Open Source · Production-Grade · CNCF Landscape

KubeBlocks ZooKeeper Operator for Kubernetes

Deploy production-grade Apache ZooKeeper ensembles in minutes. Leader election, ZAB consensus, role-aware routing, and full Day-2 operations.

Try Playground Free →Read the Docs

0

Data Loss on Failover (RPO)

99.99%

High Availability Target

100%

Open Source

Deploy ZooKeeper in 4 steps

1

Install KubeBlocks

# Add Helm repo
helm repo add kubeblocks https://apecloud.github.io/helm-charts
helm repo update

# Install KubeBlocks
helm install kubeblocks kubeblocks/kubeblocks \
  --namespace kb-system --create-namespace
2

Install ZooKeeper Addon

helm upgrade -i kb-addon-zookeeper kubeblocks/zookeeper \
  -n kb-system
3

Create a ZooKeeper Ensemble

apiVersion: apps.kubeblocks.io/v1
kind: Cluster
metadata:
  name: zookeeper-cluster
  namespace: demo
spec:
  terminationPolicy: Delete
  componentSpecs:
    - name: zookeeper
      componentDef: zookeeper
      serviceVersion: "3.9.4"
      replicas: 3
4

Ensemble is Ready

$ kubectl get cluster zookeeper-cluster -n demo
NAME                CLUSTER-DEF   STATUS    AGE
zookeeper-cluster               Running   2m

Trusted by Engineering Teams at Scale

BONC CloudBONC Cloud
China Mobile CloudChina Mobile Cloud
China Telecom CloudChina Telecom Cloud
TencentTencent
XiaomiXiaomi
Ping AnPing An
VIP.comVIP.com
KwaiKwai
Tiger BrokersTiger Brokers
CITIC SecuritiesCITIC Securities
SealOSSealOS
FastGPTFastGPT
KubeSphereKubeSphere
MomentaMomenta
360360
TilaaTilaa
OlaresOlares
Changan AutomobileChangan Automobile
State GridState Grid
BONC CloudBONC Cloud
China Mobile CloudChina Mobile Cloud
China Telecom CloudChina Telecom Cloud
TencentTencent
XiaomiXiaomi
Ping AnPing An
VIP.comVIP.com
KwaiKwai
Tiger BrokersTiger Brokers
CITIC SecuritiesCITIC Securities
SealOSSealOS
FastGPTFastGPT
KubeSphereKubeSphere
MomentaMomenta
360360
TilaaTilaa
OlaresOlares
Changan AutomobileChangan Automobile
State GridState Grid
Architecture

ZAB Consensus. Role-Aware Routing.

Every ensemble runs the ZooKeeper Atomic Broadcast protocol for strict ordering guarantees. KubeBlocks provides separate services for leader-only writes and all-node reads.

Application / Client
Write/coord  zk-cluster-zookeeper:2181
Read (all nodes)  zk-cluster-zookeeper-readable:2181
RW → roleSelector: leader
Read → all pods (no roleSelector)
Kubernetes Services
zk-cluster-zookeeper
ClusterIP · :2181 client · :8080 admin
selector: kubeblocks.io/role=leader
Endpoints auto-switch with leader
Leader
zk-cluster-zookeeper-readable
ClusterIP · :2181 client
no roleSelector — all pods
Distribute reads across all nodes
All Nodes
→ leader pod
→ any pod (load balanced)
ZooKeeper Pods · Worker Nodes
zookeeper-0LEADER
zookeeper
:2181 client · :2888 quorum · :3888 elect · :8080 admin
leader
PVC data-0 · /bitnami/zookeeper/data
zookeeper-1FOLLOWER
zookeeper
:2181 client · :2888 quorum · :3888 elect · :8080 admin
follower
PVC data-1 · /bitnami/zookeeper/data
zookeeper-2FOLLOWER
zookeeper
:2181 client · :2888 quorum · :3888 elect · :8080 admin
follower
PVC data-2 · /bitnami/zookeeper/data
ZAB Protocol (ZooKeeper Atomic Broadcast)all writes go through leader · broadcast to followers · majority ack required
Headless service — stable pod DNS for internal use (quorum, leader election, operator probes); not a client endpoint
Leader / Write Traffic
All-Node Read Traffic
Follower Pod
Persistent Storage

Leader-Only Write Service

The <cluster>-zookeeper ClusterIP service uses roleSelector to route all writes to the current leader. When the leader changes, Kubernetes endpoint controller automatically updates the service endpoints — no client reconfiguration needed.

All-Node Read Service

The <cluster>-zookeeper-readable ClusterIP service routes reads across all ensemble members, distributing load and maximizing read throughput for read-heavy workloads.

ZAB Protocol

ZooKeeper Atomic Broadcast ensures all updates are totally ordered across the ensemble. A majority quorum must acknowledge each write before it is committed — 3 nodes tolerate 1 failure, 5 nodes tolerate 2.

Comparison

How KubeBlocks Compares to Other ZooKeeper Options

FeatureKubeBlocksBitnami Helm ChartPravega ZK Operator
Kubernetes-native CRD API✓✗✓
Automatic leader failover detection✓~✓
Quorum-safe horizontal scaling✓✗✓
Vertical scaling (CPU/memory)✓✗~
PVC volume expansion✓✗✗
Role-aware service routing✓~~
Dynamic parameter reconfiguration✓✗✗
Minor version upgrade (rolling)✓~✓
Backup & restore (zoocreeper)✓✗✗
Prometheus metrics✓✓~
Stop / start cluster✓✗✗
Open Source✓✓✓
Web management UIEnterprise✗✗

✓ = Supported · ~ = Partial / Limited · ✗ = Not supported

Enterpriseindicates a capability available in KubeBlocks Enterprise, not the open-source distribution. Contact us for licensing →

Based on publicly available documentation. Features may vary by version.

Capabilities

Built for Production ZooKeeper

KubeBlocks automates the hardest parts of running ZooKeeper on Kubernetes — so your team doesn't have to.

Snapshot Backup & Restore
Scheduled snapshot backups via zoocreeper. Restore a full ensemble to any stored snapshot in minutes.
zoocreeper
Backup Timeline
Snapshot
00:00
Snapshot
08:00
Snapshot
16:00
Restore Target
20:17
1. Load SnapshotRestore nearest snapshot before the target point
→
2. Replay TXN LogApply committed transactions from the transaction log
→
3. ZK Cluster ReadyNew ensemble started, leader elected via ZAB
✓ S3-Compatible Storage
Day-2 Operations

Every Operation Declared as a Kubernetes Resource

No SSH into pods, no shell scripts. Submit an OpsRequest and KubeBlocks handles the rest.

High Availability & Scaling

✓

Horizontal Scaling

Add or remove ensemble members online. KubeBlocks ensures quorum safety — never scale below 3 nodes on an active ensemble.

✓

Vertical Scaling

Resize CPU and memory on running pods with a rolling update that preserves quorum throughout.

✓

Volume Expansion

Expand data and snapshot-log PVCs without pod restarts on supported storage classes.

✓

Rolling Restart

Controlled pod restarts with quorum-aware sequencing to keep the ensemble available.

✓

Stop / Start

Suspend the ensemble to eliminate compute cost; resume with full state and leader election.

Configuration, Observability & Backup

✓

Dynamic Configuration

Tune ZooKeeper parameters via OpsRequest — tickTime, maxClientCnxns, syncLimit — without full pod restarts.

✓

Minor Version Upgrade

Rolling upgrades across ZooKeeper 3.4 through 3.9 minor versions with health and quorum checks.

✓

Prometheus Metrics

Per-node metrics exposed on port 7000 via the built-in metrics provider; compatible with Prometheus and Grafana.

✓

Admin API

ZooKeeper Admin Server accessible on port 8080 for ruok checks, stat, and mntr commands.

✓

Backup & Restore

Snapshot-based backup via zoocreeper; restore to a new ensemble from any stored snapshot.

Also on KubeBlocks

Apache Kafka Operator for Kubernetes →

ZooKeeper is the external coordination layer for Apache Kafka 2.x. KubeBlocks manages both — deploy your Kafka cluster and ZooKeeper ensemble with a single operator and unified Day-2 operations.

Get Started

Get Started with KubeBlocks ZooKeeper Operator, Risk-Free.

Open source and production-ready. Enterprise customers get dedicated onboarding, migration support, and SLA guarantees.

Try Playground Free →Talk to the Team
✓Open Source
✓ZooKeeper & 35+ other engines
✓Production-grade HA
✓No vendor lock-in

© 2026 KUBEBLOCKS INC