# Service exposition with ListenerClasses

> Configure HDFS service exposure using ListenerClasses to control internal and external access for DataNodes and NameNodes.

The operator deploys a [Listener](https://docs.stackable.tech/home/stable/listener-operator/listener/index.md) for each DataNode and NameNode pod. They both default to only being accessible from within the Kubernetes cluster, but this can be changed by setting `.spec.{data,name}Nodes.config.listenerClass`.

Note that JournalNodes are not accessible from outside the Kubernetes cluster.

The cluster can be configured to be accessible from outside of Kubernetes like this:

```yaml
spec:
  dataNodes:
    config:
      listenerClass: external-unstable (1)
  nameNodes:
    config:
      listenerClass: external-stable (2)
```

(1) DataNode listeners should prioritize having a direct connection, to minimize network transfer overhead.
(2) NameNode listeners should prioritize having a stable address, since they are baked into the client configuration.
