Network policies are used to control inbound connections into pods. These connections can be from pods within the cluster, or from external sources.
When you install an instance of Event Streams, the required network policies will be automatically created. To review the network policies that have been applied:
Log in to your Kubernetes cluster as a cluster administrator by setting your kubectlcontext.
Run the following command to display the installed network policies for a specific namespace:
kubectl get netpol -n <namespace>
The following tables provide information about the network policies that are applicable to each pod within the Event Streams instance. If a particular pod is not required by a given Event Streams configuration, the associated network policy will not be applied.
Note: Where a network policy exposes a port to the Event Streams Cluster operator, it is configured to allow connections from any namespace.
Kafka pod
Type
Origin
Port
Reason
Enabled in policy
TCP
REST API, REST Producer and Schema Registry pods
8091
Broker communication
Always
TCP
Kafka, Cluster operator, Entity operator, Kafka Cruise Control and Kafka Exporter pods
9091
Broker communication
Always
TCP
Anywhere (can be restricted by including networkPolicyPeers in the listener configuration)
Note: If required, access to listener ports can be restricted to only those pods with specific labels by including additional configuration in the Event Streams custom resource under spec.strimziOverrides.kafka.listeners.<listener>.networkPolicyPeers.
ZooKeeper pod
Type
Origin
Port
Reason
Enabled in policy
TCP
Kafka, ZooKeeper, Cluster operator, Entity operator, Kafka Cruise Control pods
The following tables provide information about the outbound network connections (egress) initiated by pods in an Event Streams installation. If a particular pod is not required by an Event Streams configuration, the associated outbound connection is not applicable.
Kafka pod
Type
Destination
Pod Label
Port
Reason
TCP
Kafka
app.kubernetes.io/name=kafka
9091
Broker replication
TCP
ZooKeeper
app.kubernetes.io/name=zookeeper
2181
ZooKeeper communication
ZooKeeper pod
Type
Destination
Pod Label
Port
Reason
TCP
ZooKeeper
app.kubernetes.io/name=zookeeper
2888
ZooKeeper clustering
TCP
ZooKeeper
app.kubernetes.io/name=zookeeper
3888
ZooKeeper leader elections
Geo-replicator pod
Type
Destination
Pod Label
Port
Reason
TCP
Geo-replicator
app.kubernetes.io/name=kafka-mirror-maker-2
8083
Geo-replicator cluster traffic
Note: Geo-replicator destination is external to the cluster.