# Stackable Operator for Apache ZooKeeper

> Manage Apache ZooKeeper ensembles with the Stackable Kubernetes operator. Supports ZooKeeper versions, custom images, and integrates with Hadoop, Kafka, and more.

-   [GitHub](https://github.com/stackabletech/zookeeper-operator/)

-   [Feature Tracker](https://features.stackable.tech/unified)

-   [CRD documentation](https://crds.stackable.tech/zookeeper-operator/26.7.0/)


The Stackable operator for Apache ZooKeeper is a Kubernetes operator for deploying and managing [Apache ZooKeeper](https://zookeeper.apache.org/) ensembles. Apache ZooKeeper is an open-source distributed coordination service that facilitates synchronization, configuration management and leader election in distributed systems. ZooKeeper is often used for these tasks in the Apache Hadoop ecosystem. Within the Stackable Platform, the Stackable operators for [Apache HBase](https://docs.stackable.tech/home/stable/hbase/index.md), [Apache Hadoop HDFS](https://docs.stackable.tech/home/stable/hdfs/index.md), [Apache Kafka](https://docs.stackable.tech/home/stable/kafka/index.md), [Apache NiFi](https://docs.stackable.tech/home/stable/nifi/index.md) and [Apache Druid](https://docs.stackable.tech/home/stable/druid/index.md) depend on the ZooKeeper operator.

## Getting started

Get started with Apache ZooKeeper and the Stackable operator by following the [Getting started](https://docs.stackable.tech/home/stable/zookeeper/getting_started/index.md) guide, it guides you through the [installation](https://docs.stackable.tech/home/stable/zookeeper/getting_started/installation/index.md) process. Afterward, consult the [Usage guide](https://docs.stackable.tech/home/stable/zookeeper/usage_guide/index.md) to learn more about configuring ZooKeeper for your needs. You can also deploy a [demo](https://docs.stackable.tech/home/stable/zookeeper/index.md) to see an example deployment of ZooKeeper together with other data products.

## Operator model

The operator manages two custom resources: _ZookeeperCluster_ and _ZookeeperZnode_. ZooKeeper only has a single process that it runs, so the cluster resource only has a single corresponding [role](https://docs.stackable.tech/home/stable/concepts/stacklet/index.md) called _server_.

![A diagram depicting the Kubernetes resources created by the Stackable operator for Apache ZooKeeper](https://docs.stackable.tech/home/stable/zookeeper/_images/zookeeper_overview.drawio.svg)

For every role group the operator creates a ConfigMap and StatefulSet which can have multiple replicas (Pods). Every role group is accessible through its own Service, and there is a Service for the whole Cluster.

The operator creates a [service discovery ConfigMap](https://docs.stackable.tech/home/stable/concepts/service-discovery/index.md) for the ZooKeeper instance, as well as for each ZNode. The discovery ConfigMaps contain information on how to connect to ZooKeeper. The ZNode discovery ConfigMap give access information for the ZNode. [Learn more about ZNodes](https://docs.stackable.tech/home/stable/zookeeper/znodes/index.md).

## Dependencies

Apache ZooKeeper and the Stackable operator have no dependencies besides the [Stackable Commons Operator](https://docs.stackable.tech/home/stable/commons-operator/index.md), [Stackable Secret Operator](https://docs.stackable.tech/home/stable/secret-operator/index.md) and [Stackable Listener Operator](https://docs.stackable.tech/home/stable/listener-operator/index.md).

## Demos

Apache ZooKeeper is a dependency of [Apache HBase](https://docs.stackable.tech/home/stable/hbase/index.md), [Apache Hadoop HDFS](https://docs.stackable.tech/home/stable/hdfs/index.md), [Apache Kafka](https://docs.stackable.tech/home/stable/kafka/index.md) and [Apache NiFi](https://docs.stackable.tech/home/stable/nifi/index.md), thus any demo that uses one or more of these components also deploys a ZooKeeper ensemble. Here is the list of the demos that include ZooKeeper:

-   [data-lakehouse-iceberg-trino-spark](https://docs.stackable.tech/home/stable/demos/data-lakehouse-iceberg-trino-spark/index.md)

-   [hbase-hdfs-cycling-data](https://docs.stackable.tech/home/stable/demos/hbase-hdfs-load-cycling-data/index.md)

-   [jupyterhub-pyspark-hdfs-anomaly-detection-taxi-data](https://docs.stackable.tech/home/stable/demos/jupyterhub-pyspark-hdfs-anomaly-detection-taxi-data/index.md)

-   [logging](https://docs.stackable.tech/home/stable/demos/logging/index.md)

-   [nifi-kafka-druid-earthquake-data](https://docs.stackable.tech/home/stable/demos/nifi-kafka-druid-earthquake-data/index.md)

-   [nifi-kafka-druid-water-level-data](https://docs.stackable.tech/home/stable/demos/nifi-kafka-druid-water-level-data/index.md)


## Supported versions

The Stackable operator for Apache ZooKeeper currently supports the ZooKeeper versions listed below. To use a specific ZooKeeper version in your ZookeeperCluster, you have to specify an image - this is explained in the [Product image selection](https://docs.stackable.tech/home/stable/concepts/product-image-selection/index.md) documentation. The operator also supports running images from a custom registry or running entirely customized images; both of these cases are explained under [Product image selection](https://docs.stackable.tech/home/stable/concepts/product-image-selection/index.md) as well.

-   3.9.5 (LTS)

-   3.9.4 (Deprecated)


## Useful links

-   The [zookeeper-operator](https://github.com/stackabletech/zookeeper-operator/) GitHub repository

-   The operator feature overview in the [feature tracker](https://features.stackable.tech/unified)

-   The [ZookeeperCluster](https://crds.stackable.tech/26.7.0/zookeeper.stackable.tech/zookeepercluster/v1alpha1/) and [ZookeeperZnode](https://crds.stackable.tech/26.7.0/zookeeper.stackable.tech/zookeeperznode/v1alpha1/) CRD documentation
