// Module included in the following assemblies:
//
// assembly-zookeeper-replicas.adoc

[id='proc-configuring-zookeeper-replicas-{context}']
= Changing the number of ZooKeeper replicas

.Prerequisites

* A Kubernetes cluster is available.
* The Cluster Operator is running.

.Procedure

. Open the YAML configuration file that contains the `Kafka` resource specifying the cluster deployment.

. In the `spec.zookeeper.replicas` property in the `Kafka` resource, enter the number of replicated ZooKeeper servers.
For example:
+
[source,yaml,subs=attributes+]
----
apiVersion: {KafkaApiVersion}
kind: Kafka
metadata:
  name: my-cluster
spec:
  kafka:
    # ...
  zookeeper:
    # ...
    replicas: 3
    # ...
----

. Apply the new configuration to create or update the resource.
+
Use `kubectl apply`:
[source,shell,subs=+quotes]
kubectl apply -f _kafka.yaml_
+
where `_kafka.yaml_` is the YAML configuration file for the resource that you want to configure; for example, `kafka-persistent.yaml`.
