Description:
I followed the documentation provided for setting up Kafka with external ClusterIP services in Kubernetes. However, I'm encountering an issue where the Kafka broker cannot access outside the Kubernetes cluster.

Steps to Reproduce:

1. Followed the documentation provided 
2. Configured the Kafka broker and ingress as instructed.
3. Attempted to access Kafka from outside the Kubernetes cluster.



Expected Behavior:


The Kafka broker should be accessible from outside the Kubernetes cluster using the configured ClusterIP services and ingress.



Actual Behavior:
Encountering a timeout error: [AdminClient clientId=kafka-ui-admin-1716828247-137] Disconnecting from node -1 due to socket connection setup timeout. The timeout value is 9125 ms.



Additionally, I would appreciate it if someone could review my configuration to identify any potential mistakes or misconfigurations. Below is the configuration I've used:


apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: kafka-ingress
  namespace: zee
  annotations:
    nginx.ingress.kubernetes.io/configuration-snippet: |
      tcp:  9094: "{{ include "common.names.namespace" . }}/{{ include "common.names.fullname" . }}-0-external:9094"
spec:
  ingressClassName: nginx
  rules:
  - host: xxx.example.com
    http:
      paths:
      - path: /
        pathType: ImplementationSpecific
        backend:
          service:
            name: my-release-kafka-broker-0-external
            port:
              number: 9094








Kafka Broker Cannot Access Outside Kubernetes Cluster via ClusterIP Services
This is a GitHub Issue
repo:ingress-nginx
owner:kubernetes
Title : Kafka Broker Cannot Access Outside Kubernetes Cluster via ClusterIP Services
Issue date:

--- start body ---
Description:
I followed the documentation provided for setting up Kafka with external ClusterIP services in Kubernetes. However, I'm encountering an issue where the Kafka broker cannot access outside the Kubernetes cluster.

Steps to Reproduce:

1. Followed the documentation provided 
2. Configured the Kafka broker and ingress as instructed.
3. Attempted to access Kafka from outside the Kubernetes cluster.



Expected Behavior:


The Kafka broker should be accessible from outside the Kubernetes cluster using the configured ClusterIP services and ingress.



Actual Behavior:
Encountering a timeout error: [AdminClient clientId=kafka-ui-admin-1716828247-137] Disconnecting from node -1 due to socket connection setup timeout. The timeout value is 9125 ms.



Additionally, I would appreciate it if someone could review my configuration to identify any potential mistakes or misconfigurations. Below is the configuration I've used:


apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: kafka-ingress
  namespace: zee
  annotations:
    nginx.ingress.kubernetes.io/configuration-snippet: |
      tcp:  9094: "{{ include "common.names.namespace" . }}/{{ include "common.names.fullname" . }}-0-external:9094"
spec:
  ingressClassName: nginx
  rules:
  - host: xxx.example.com
    http:
      paths:
      - path: /
        pathType: ImplementationSpecific
        backend:
          service:
            name: my-release-kafka-broker-0-external
            port:
              number: 9094








--- end body ---
