KubeBlocks
BlogsEnterprise
⌘K
​
Blogs

Overview
Quickstart
Architecture

Operations

Lifecycle Management
Vertical Scaling
Horizontal Scaling
Volume Expansion
Configuration
Minor Version Upgrade
Manage Services

Backup And Restore

Backup
Restore

Monitoring

Observability for ZooKeeper Clusters
FAQs
  1. Prerequisites
  2. Configuration Files
  3. Dynamic Configuration (zoo.cfg.dynamic)
  4. Static Configuration (zoo.cfg)
  5. Cleanup

ZooKeeper Configuration in KubeBlocks

This guide describes the two ZooKeeper configuration files managed by KubeBlocks and explains how each is handled.

Prerequisites

    Before proceeding, verify your environment meets these requirements:

    • A functional Kubernetes cluster (v1.21+ recommended)
    • kubectl v1.21+ installed and configured with cluster access
    • Helm installed (installation guide)
    • KubeBlocks installed (installation guide)
    • ZooKeeper Add-on installed and a ZooKeeper cluster running (see Quickstart)

    Configuration Files

    KubeBlocks manages two ZooKeeper configuration files:

    FileTypeHow It Is UpdatedReload Behavior
    zoo.cfgStaticRendered from addon template (read-only at runtime)Requires pod restart
    zoo.cfg.dynamicDynamicAutomatically updated by KubeBlocks during horizontal scalingHot reload

    Dynamic Configuration (zoo.cfg.dynamic)

    The zoo.cfg.dynamic file manages ZooKeeper ensemble membership — specifically the server.N entries that define which servers are in the ensemble.

    KubeBlocks automatically maintains this file during horizontal scaling:

    • When you scale out, a new server.N entry is added
    • When you scale in, the leaving member's entry is removed

    You do not need to modify zoo.cfg.dynamic manually.

    WARNING

    Only server.N entries are valid in zoo.cfg.dynamic.

    Placing other parameters (e.g., syncLimit, tickTime) in this file will cause ZooKeeper to fail on startup with an Unrecognised parameter error.

    Example of a valid zoo.cfg.dynamic for a 3-node ensemble:

    server.0 = zookeeper-cluster-zookeeper-0.zookeeper-cluster-zookeeper-headless.demo.svc.cluster.local:2888:3888:participant server.1 = zookeeper-cluster-zookeeper-1.zookeeper-cluster-zookeeper-headless.demo.svc.cluster.local:2888:3888:participant server.2 = zookeeper-cluster-zookeeper-2.zookeeper-cluster-zookeeper-headless.demo.svc.cluster.local:2888:3888:participant

    View the current dynamic configuration:

    kubectl exec -n demo zookeeper-cluster-zookeeper-0 -- \ cat /opt/bitnami/zookeeper/dynamic/zoo.cfg.dynamic

    Static Configuration (zoo.cfg)

    The zoo.cfg is rendered from the addon's ConfigMap template and contains the fixed cluster parameters:

    ParameterValueDescription
    tickTime2000Basic time unit in milliseconds
    initLimit10Ticks allowed for initial follower sync
    syncLimit30Ticks allowed for follower-leader sync
    clientPort2181Client connection port
    maxClientCnxns500Max concurrent client connections per IP
    autopurge.snapRetainCount5Number of snapshots to retain
    autopurge.purgeInterval12Autopurge interval in hours
    metricsProvider.httpPort7000Prometheus metrics port
    reconfigEnabledtrueEnables ZooKeeper dynamic reconfiguration
    standaloneEnabledfalseRequired for ensemble mode

    View the current static configuration:

    kubectl exec -n demo zookeeper-cluster-zookeeper-0 -- \ cat /opt/bitnami/zookeeper/conf/zoo.cfg
    Example Output
    tickTime=2000 initLimit=10 syncLimit=30 dataDir=/bitnami/zookeeper/data dataLogDir=/bitnami/zookeeper/log clientPort=2181 maxClientCnxns=500 autopurge.snapRetainCount=5 autopurge.purgeInterval=12 metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider metricsProvider.httpPort=7000 metricsProvider.exportJvmInfo=true 4lw.commands.whitelist=srvr, mntr, ruok, conf, stat, sync standaloneEnabled=false reconfigEnabled=true dynamicConfigFile=/opt/bitnami/zookeeper/dynamic/zoo.cfg.dynamic audit.enable=true
    NOTE

    Static parameters in zoo.cfg are rendered from the addon template at cluster creation time. The current version of the ZooKeeper addon does not expose these as user-configurable parameters through the KubeBlocks API. If you need to customize static parameters, consider opening an issue or contributing to the kubeblocks-addons repository.

    Cleanup

    kubectl delete cluster zookeeper-cluster -n demo kubectl delete ns demo

    © 2026 KUBEBLOCKS INC