# Discovery Profiles

The Stackable Operator for Apache ZooKeeper creates a number of discovery profiles, which are client configuration bundles that allow access to the Apache ZooKeeper cluster. These are published into the Kubernetes cluster as [ConfigMap](https://kubernetes.io/docs/concepts/configuration/configmap/) objects.

Discovery profiles are generated for each ZookeeperCluster and [ZookeeperZnode](https://docs.stackable.tech/home/stable/zookeeper/znodes/index.md) object, the name of which is the "base name" of the profile.

## Profiles

### Default

This profile allows access to the Apache ZooKeeper cluster from inside the Kubernetes cluster, and connects directly to the Pod identity.

The name of the ConfigMap created for this discovery profile is `$BASENAME`.

### NodePort

This profile allows access to the Apache ZooKeeper cluster from anywhere, inside or outside of the Kubernetes cluster.

The name of the ConfigMap created for this discovery profile is `$BASENAME-nodeport`.

## Contents

Each discovery profile contains the following fields:

`ZOOKEEPER`

A connection string, as accepted by [the official Java client](https://zookeeper.apache.org/doc/r3.9.5/apidocs/zookeeper-server/org/apache/zookeeper/ZooKeeper.html#%3Cinit%3E\(java.lang.String,int,org.apache.zookeeper.Watcher\)), e.g. `test-zk-server-default-0.test-zk-server-default.kuttl-test-proper-spaniel.svc.cluster.local:2282,test-zk-server-default-1.test-zk-server-default.kuttl-test-proper-spaniel.svc.cluster.local:2282/znode-4e169890-d2eb-4d62-9515-e4786f0ac58e`

`ZOOKEEPER_HOSTS`

A comma-separated list of `node1:port1,node2:port2,…​`, e.g. `test-zk-server-default-0.test-zk-server-default.kuttl-test-proper-spaniel.svc.cluster.local:2282,test-zk-server-default-1.test-zk-server-default.kuttl-test-proper-spaniel.svc.cluster.local:2282`

`ZOOKEEPER_CHROOT`

The name of the root ZNode associated with the discovery profile, should be used if (and only if) connecting using `ZOOKEEPER_HOSTS` (rather than `ZOOKEEPER`), e.g. `/znode-4e169890-d2eb-4d62-9515-e4786f0ac58e` in case of a ZNode discovery or `/` in case of a ZookeeperServer discovery

`ZOOKEEPER_CLIENT_PORT`

The port clients should use when connecting, e.g. `2282`
