In our previous blog post, we discussed a workaround for the DNS error that occurs when an application running on a local Windows machine connects to Kafka. In this post, we will discuss the proper solution.
Our Kafka cluster runs inside Docker through a local kind Kubernetes cluster rather than directly on the host machine. Kafka advertises broker addresses using Kubernetes DNS names, which can be resolved from inside the cluster but not by an application running on Windows. To make Kafka reachable from the host, we must expose the required ports from the kind node container to the host machine.