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

[id='proc-connnecting-to-zookeeper-{context}']
= Connecting to ZooKeeper from a terminal

Most Kafka CLI tools can connect directly to Kafka.
So you should under normal circumstances not need to connect to ZooKeeper.
In case it is needed, you can follow this procedure.
Open a terminal inside a ZooKeeper container to use Kafka CLI tools that require a ZooKeeper connection.

.Prerequisites

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

.Procedure

. Open the terminal using the Kubernetes console or run the `exec` command from your CLI.
+
For example:
+
[source,shell,subs="+quotes,attributes"]
----
kubectl exec -it _my-cluster_-zookeeper-0 -- bin/kafka-topics.sh --list --zookeeper localhost:12181
----
+
Be sure to use `localhost:12181`.
+
You can now run Kafka commands to ZooKeeper.
