<p>After running:</p>
<pre><code>helm repo add bitnami https://charts.bitnami.com/bitnami
helm install my-release bitnami/kafka
</code></pre>
<p>I then got pods:</p>
<pre><code>$kubectl get pods
NAME                     READY   STATUS    RESTARTS   AGE
my-release-kafka-0       1/1     Running   2          24m
my-release-zookeeper-0   1/1     Running   0          24m
</code></pre>
<p>I attempted to access the Kafka running in my cluster to list topics:</p>
<pre><code>$kafka-topics --bootstrap-server localhost:9092 --list
[2022-05-15 22:31:05,190] WARN [AdminClient clientId=adminclient-1] Connection to node -1 (localhost/127.0.0.1:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
</code></pre>
<p>It failed. I then tried to forward port 9092 from the guest to the host:</p>
<pre><code>$kubectl port-forward my-release-kafka-0 9092:9092
Forwarding from 127.0.0.1:9092 -&gt; 9092
Forwarding from [::1]:9092 -&gt; 9092
</code></pre>
<p>In another tab, I tried and failed again:</p>
<pre><code>$kafka-topics --bootstrap-server localhost:9092 --list
[2022-05-15 22:31:35,288] WARN [AdminClient clientId=adminclient-1] Error connecting to node my-release-kafka-0.my-release-kafka-headless.default.svc.cluster.local:9092 (id: 0 rack: null) (org.apache.kafka.clients.NetworkClient)
java.net.UnknownHostException: my-release-kafka-0.my-release-kafka-headless.default.svc.cluster.local: nodename nor servname provided, or not known
    at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
    at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:929)
</code></pre>
<p>What is the meaning of:</p>
<pre><code>Error connecting to node my-release-kafka-0.my-release-kafka-headless.default.svc.cluster.local:9092
</code></pre>
<p>and how can I address this problem, i.e. so that I can access my cluster's Kafka from my local, the host?</p>

Kevin Meredith
<p>It returns the pod DNS name because that's the <code>advertised.listeners</code> setting on the broker.</p>
<p>I'd recommend using Strimzi Operator rather than Bitnami Helm Charts, and reading the documentation on it about accessing the brokers using LoadBalancer or Ingress resources</p>
<p>Or decipher what you need from the Traffic Exposure parameters - <a href="https://github.com/bitnami/charts/tree/master/bitnami/kafka/#traffic-exposure-parameters" rel="nofollow noreferrer">https://github.com/bitnami/charts/tree/master/bitnami/kafka/#traffic-exposure-parameters</a> + <a href="https://github.com/bitnami/charts/tree/master/bitnami/kafka/#accessing-kafka-brokers-from-outside-the-cluster" rel="nofollow noreferrer">https://github.com/bitnami/charts/tree/master/bitnami/kafka/#accessing-kafka-brokers-from-outside-the-cluster</a></p>
