<p>I have created a Kafka cluster using the Strimzi Kafka operator on minikube to learn the basics. I am trying to access Kafka inside the minikube environment from my Host and for this I created a Kafka Node port:</p>

<pre><code>apiVersion: kafka.strimzi.io/v1beta1
kind: Kafka
metadata:
  name: kafka-cluster
spec:
  kafka:
    version: 2.4.0
    replicas: 3
    listeners:
      plain: {}
      tls: {}
      external:
        type: nodeport
        tls: false
        overrides:
          bootstrap:
            nodePort: 32100
          brokers:
          - broker: 0
            nodePort: 32000
          - broker: 1
            nodePort: 32001
          - broker: 2
            nodePort: 32002  
...
...
...

NAME                                     TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                               AGE
kafka-cluster-kafka-0                    NodePort    10.96.40.176    &lt;none&gt;        9094:32000/TCP                        7d
kafka-cluster-kafka-1                    NodePort    10.96.138.2     &lt;none&gt;        9094:32001/TCP                        7d
kafka-cluster-kafka-2                    NodePort    10.96.209.16    &lt;none&gt;        9094:32002/TCP                        7d
kafka-cluster-kafka-bootstrap            ClusterIP   10.96.216.169   &lt;none&gt;        9091/TCP,9092/TCP,9093/TCP,9404/TCP   7d
kafka-cluster-kafka-brokers              ClusterIP   None            &lt;none&gt;        9091/TCP,9092/TCP,9093/TCP            7d
kafka-cluster-kafka-exporter             ClusterIP   10.96.17.45     &lt;none&gt;        9404/TCP                              47d
kafka-cluster-kafka-external-bootstrap   NodePort    10.96.252.97    &lt;none&gt;        9094:32100/TCP                        7d
kafka-cluster-zookeeper-client           ClusterIP   10.96.155.34    &lt;none&gt;        9404/TCP,2181/TCP                     7d
kafka-cluster-zookeeper-nodes            ClusterIP   None            &lt;none&gt;        2181/TCP,2888/TCP,3888/TCP            7d




</code></pre>

<p>All seems to work well so far and I am able to publish messages to the Kafka topic using kafka-cluster-kafka-external-bootstrap <code>(withBootstrapServers("192.168.99.107:32100")</code>. Since I am learning things step-by-step, I wanted to see if I could assign a name instead of referring by the IP address.</p>

<p>Is there an easy way to do it in the Nodeport configuration? I have been stuck on this issue for a week. Appreciate a nudge in the right direction!</p>

irrelevantUser
<p>That mainly depends on your infrastructure. Minikube is using IP addresses as both node address and loadbalancer address. That is why Strimzi always gives you the address based on the IP address. If you would run it on Kubernetes for example somewhere on AWS, you would out of the box get DNS names instead of the IPs.</p>

<p>Even with Minikube you can configure Strimzi to use some names you specify: <a href="https://strimzi.io/docs/latest/full.html#con-kafka-broker-external-listeners-addresses-deployment-configuration-kafka" rel="nofollow noreferrer">https://strimzi.io/docs/latest/full.html#con-kafka-broker-external-listeners-addresses-deployment-configuration-kafka</a> ... but you would need to make sure these route to the Minikube IP address for example by adding them anually to <code>/etc/hosts</code>. But TBH, normally this is not worth it with Minikube.</p>
