Zookeeper in a Project
![](../../__attachments/143696348/enterprise%20-%20badge@500w.png?inst-v=fbc98f0a-f9ae-4d4c-828f-dc0defe966ca)
Deploying ZooKeeper in a project
Get started
To get started with creating ZooKeeper clusters in your project namespace, you first need to deploy the ZooKeeper operator in the workspace where the project exists.
After you deploy the ZooKeeper operator, you can create ZooKeeper Clusters by applying a ZookeeperCluster
custom resource on each attached cluster in a project’s namespace.
A Helm chart exists in the ZooKeeper operator repository that can assist with deploying ZooKeeper clusters.
Example Deployment
If you need to manage these custom resources across all clusters in a project, it is recommended you use Project Deployments which enables you to leverage GitOps to deploy the resources. Otherwise, you will need to create the resources manually in each cluster.
Follow these steps to deploy a ZooKeeper cluster in a project namespace. This procedure results in a running ZooKeeper cluster, ready for use in your project’s namespace.
Set the
PROJECT_NAMESPACE
environment variable to the name of your project’s namespace:CODEexport PROJECT_NAMESPACE=<project namespace>
Create a ZooKeeper Cluster custom resource in your project namespace
CODEkubectl apply -f - <<EOF apiVersion: zookeeper.pravega.io/v1beta1 kind: ZookeeperCluster metadata: name: zookeeper namespace: ${PROJECT_NAMESPACE} spec: replicas: 1 EOF
Check the status of your ZooKeeper cluster using
kubectl
:CODEkubectl get zookeeperclusters -n ${PROJECT_NAMESPACE}
CODENAME REPLICAS READY REPLICAS VERSION DESIRED VERSION INTERNAL ENDPOINT EXTERNAL ENDPOINT AGE zookeeper 1 1 0.2.13 0.2.13 10.100.200.18:2181 N/A 94s
Delete ZooKeeper clusters
Follow these steps to delete the Zookeeper clusters.
View
ZookeeperClusters
in all namespaces:CODEkubectl get zookeeperclusters -A
Delete a specific
ZookeeperCluster
:CODEkubectl -n ${PROJECT_NAMESPACE} delete zookeepercluster <name of zookeepercluster>