- I have Kafka deployed and running in Kubernetes cluster. I am using this image from docker hub - https://hub.docker.com/r/cloudtrackinc/kubernetes-kafka/
- I have 3 kube-nodes in my kubernetes cluster. I have 3 Kafka and 3 zookeeper applications running and I have services zoo1,zoo2,zoo3 and kafka-1, kafka-2 and kafka-3 running corresponding to them. I am able to publish/consume from inside kubernetes cluster but I am not able to publish/consume from outside of kubernetes cluster i.e., from external machine not part of kubernetes cluster.
- I am able to reach the kube-nodes from external machine - basically I can ping them using name/ip.
- I am not using any external load balancer but I have a DNS that can resolve both my external machine and kube-nodes.
- Using NodePort or ExternalIP to expose the Kafka service does not work in this case.
- Setting
KAFKA_ADVERTISED_HOST_NAME
orKAFKA_ADVERTISED_LISTENERS
in Kafka RC YML that ultimately setADVERTISED_HOST_NAME
/ADVERTISED_LISTENERS
properties inserver.properties
either does not help accessing kafka from outside of kubernetes cluster.
Please suggest how can I publish/consume from outside of kubernetes cluster. Thanks much!