zookeeper
by CloudPirates
Apache ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services.
About this chart
Zookeeper Helm Chart
Apache ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services.
Quick Start
Prerequisites
- Kubernetes 1.24+
- Helm 3.2.0+
- PV provisioner support in the underlying infrastructure (if persistence is enabled)
Installation
Installing the Chart
To install the chart with the release name my-zookeeper:
helm install my-zookeeper oci://registry-1.docker.io/cloudpirates/zookeeper
To install with custom values:
helm install my-zookeeper oci://registry-1.docker.io/cloudpirates/zookeeper -f my-values.yaml
Or install directly from the local chart:
helm install my-zookeeper ./charts/zookeeper
The command deploys Zookeeper on the Kubernetes cluster in the default configuration. The Configuration section lists the parameters that can be configured during installation.
Security & Signature Verification
This Helm chart is cryptographically signed with Cosign to ensure authenticity and prevent tampering.
Public Key:
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE5U+rM2d3hDjgP5T3cLShuuQIU9vR
Z4/G+Nug6q5vRa+C3qUA1wXjbaJFAfcIrv5VjmYAYOj13shnPpp3Zh4fnQ==
-----END PUBLIC KEY-----
To verify the helm chart before installation, copy the public key to the file cosign.pub and run cosign:
cosign verify --key cosign.pub registry-1.docker.io/cloudpirates/zookeeper:<version>
Getting Started
- Connect to ZooKeeper from inside the cluster:
kubectl run zk-client --rm --tty -i --restart='Never' \
--image zookeeper:latest -- bash
# Inside the pod:
zkCli.sh -server my-zookeeper:2181
Configuration
Global parameters
| Parameter | Description | Default |
|---|---|---|
global.imageRegistry | Global Docker image registry | "" |
global.imagePullSecrets | Global Docker registry secret names as an array | [] |
Image Configuration
| Parameter | Description | Default |
|---|---|---|
image.registry | ZooKeeper image registry | docker.io |
image.repository | ZooKeeper image repository | zookeeper |
image.tag | ZooKeeper image tag | 3.9.4@sha256:2408ba6f6eb91a4dbf65548428b90f9e5e9cf9d77e5f280a4bf80270d465a80f |
image.imagePullPolicy | ZooKeeper image pull policy | Always |
Common Parameters
| Parameter | Description | Default |
|---|---|---|
nameOverride | String to partially override fullname | "" |
fullnameOverride | String to fully override fullname | "" |
namespaceOverride | String to override the namespace for all resources | "" |
commonLabels | Labels to add to all deployed objects | {} |
commonAnnotations | Annotations to add to all deployed objects | {} |
replicaCount | Number of ZooKeeper replicas to deploy | 3 |
podDisruptionBudget.enabled | Create a Pod Disruption Budget to ensure high availability during voluntary disruptions | true |
podDisruptionBudget.minAvailable | minAvailable for Pod Disruption Budget. Value is not mandatory. | "" |
podDisruptionBudget.maxUnavailable | minAvailable for Pod Disruption Budget. Value is not mandatory. | "" |
networkPolicy.enabled | Enable network policies | true |
command | Override default container command (useful when the default entrypoint needs to be replaced) | [] |
ZooKeeper Configuration
| Parameter | Description | Default |
|---|---|---|
zookeeperConfig.tickTime | ZooKeeper tick time | 2000 |
zookeeperConfig.initLimit | ZooKeeper init limit | 10 |
zookeeperConfig.syncLimit | ZooKeeper sync limit | 5 |
zookeeperConfig.electionPortBindRetry | ZooKeeper election port bind retry | 10 |
zookeeperConfig.maxClientCnxns | ZooKeeper max client connections | 60 |
zookeeperConfig.standaloneEnabled | Enable standalone mode | "false" |
zookeeperConfig.adminServerEnabled | Enable admin server | "false" |
zookeeperConfig.commandsWhitelist | 4-letter word commands whitelist | srvr |
zookeeperConfig.customServers | Custom zoo.cfg server lines. When set, generated server.N entries are replaced by these values | [] |
zookeeperConfig.autopurge.purgeInterval | Autopurge purge interval (hours) | 24 |
zookeeperConfig.autopurge.snapRetainCount | Autopurge snapshot retain count | 3 |
zookeeperConfig.admin.enableServer | Enable the admin server | "false" |
zookeeperConfig.admin.serverPort | Admin server port | 8080 |
zookeeperConfig.admin.serverAddress | Admin server address | 0.0.0.0 |
zookeeperConfig.admin.idleTimeout | Admin server connection idle timeout (milliseconds) | 30000 |
zookeeperConfig.admin.commandUrl | Admin server command URL | /commands |
zookeeperConfig.extraConfigs | Extra ZooKeeper configuration lines appended to zoo.cfg | [] |
Metrics
| Parameter | Description | Default |
|---|---|---|
metrics.enabled | Enable Prometheus metrics exporter | true |
metrics.service.type | Metrics service type | ClusterIP |
metrics.service.ports.port | Metrics service port | 7000 |
metrics.service.annotations | Additional custom annotations for Metrics service | {} |
metrics.service.labels | Additional labels for metrics service | {} |
metrics.serviceMonitor.enabled | Create ServiceMonitor resource(s) for scraping metrics using Prometheus Operator | false |
metrics.serviceMonitor.namespace | Namespace in which to create ServiceMonitor resource(s) | "" |
metrics.serviceMonitor.interval | Interval at which metrics should be scraped | 10s |
metrics.serviceMonitor.scrapeTimeout | Timeout after which the scrape is ended | "" |
metrics.serviceMonitor.relabelings | Additional relabeling of metrics | [] |
metrics.serviceMonitor.metricRelabelings | Additional metric relabeling of metrics | [] |
metrics.serviceMonitor.honorLabels | Honor metrics labels | false |
metrics.serviceMonitor.selector | Prometheus instance selector labels | {} |
metrics.serviceMonitor.annotations | Additional custom annotations for the ServiceMonitor | {} |
metrics.serviceMonitor.namespaceSelector | Namespace selector for ServiceMonitor | {} |
Service Configuration
| Parameter | Description | Default |
|---|---|---|
service.type | Kubernetes service type | ClusterIP |
service.trafficDistribution | Kubernetes service traffic distribution | "" |
service.ports.client | ZooKeeper client service port | 2181 |
service.ports.secureClient | TLS client port. Set to null to disable (default). When set, also configure SSL via zookeeperConfig.extraConfigs and mount keystore files with extraVolumes/extraVolumeMounts. Setting the port without SSL config will cause startup failure. | null |
service.ports.quorum | ZooKeeper quorum service port | 2888 |
service.ports.leaderElection | ZooKeeper leader election service port | 3888 |
service.ports.admin | ZooKeeper admin service port | 8080 |
service.annotations | Additional annotations to add to the service | {} |
External Access
| Parameter | Description | Default |
|---|---|---|
externalAccess.enabled | Enable per-pod external LoadBalancer services for client access from outside the cluster | false |
externalAccess.service.type | Kubernetes service type for external access services | LoadBalancer |
externalAccess.service.port | External client port exposed on each LoadBalancer | 2181 |
externalAccess.service.annotations | Annotations applied to each external service (e.g. AWS NLB settings) | {} |
externalAccess.service.loadBalancerIPs | Static LoadBalancer IP per replica; list length must match replicaCount | [] |
externalAccess.service.loadBalancerSourceRanges | Source CIDR ranges allowed to reach the external LoadBalancers | [] |
externalAccess.service.externalTrafficPolicy | External traffic policy for LoadBalancer/NodePort services (Local recommended for per-pod LBs) | Local |
externalAccess.service.labels | Extra labels applied to each external service | {} |
externalAccess.service.hostnameDomain | Extra annotation external-dns.alpha.kubernetes.io/hostname per replica: {release}-{ordinal}.{domain}. Requires External-DNS with that zone in domainFilters | "" |
When enabled, the chart creates one external service per ZooKeeper pod (e.g. release-zookeeper-0-external). Clients outside the cluster should use the LoadBalancer hostnames and client port in their connection string. Quorum traffic remains on the internal headless service; zoo.cfg server entries are not changed.
Example for AWS NLBs:
externalAccess:
enabled: true
service:
hostnameDomain: int.example.com
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: "external"
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: "ip"
service.beta.kubernetes.io/aws-load-balancer-scheme: "internal"
service.beta.kubernetes.io/aws-load-balancer-target-group-attributes: "preserve_client_ip.enabled=true"
Use aws-load-balancer-scheme internal if clients are in the VPC, internet-facing if they're on the public internet.
Persistence
| Parameter | Desc
Deploy zookeeper with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has zookeeper on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartzookeeper is pinned at v0.15.6 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply