apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: my-cluster-network-policy-kafka
spec:
  ingress:
  - ports:
    - port: 9090
      protocol: TCP
    from:
    - podSelector:
        matchLabels:
          strimzi.io/name: my-cluster-kafka
  - ports:
    - port: 9091
      protocol: TCP
    from:
    - podSelector:
        matchLabels:
          strimzi.io/kind: cluster-operator
    - podSelector:
        matchLabels:
          strimzi.io/name: my-cluster-kafka
    - podSelector:
        matchLabels:
          strimzi.io/name: my-cluster-entity-operator
    - podSelector:
        matchLabels:
          strimzi.io/name: my-cluster-kafka-exporter
    - podSelector:
        matchLabels:
          strimzi.io/name: my-cluster-cruise-control
  - ports:
    - port: 9092
      protocol: TCP
  - ports:
    - port: 9093
      protocol: TCP
  - ports:
    - port: 9404
      protocol: TCP
    from:
    - podSelector:
        matchLabels:
          app: prometheus
  podSelector:
    matchLabels:
      strimzi.io/name: my-cluster-kafka
  policyTypes:
  - Ingress