<p>I have a separate VM in the same network as my kubernetes in Azure.
I have a kafka pod and I am able to reach this pod using the IP. The problem is that the pod IP is changing all the time.</p>
<p>Is there any way to get the correct IP each time the pod IP is changing?</p>

NoamiA
<p>I would suggest using a <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">kubernetes service</a> to expose pod. This avoids the problem with change in POD IP because service IP does not change.</p>
<p>Kubernetes <code>ServiceTypes</code> allow you to specify what kind of Service you want. The default is <code>ClusterIP</code>.</p>
<p>Type values and their behaviors are:</p>
<p><code>ClusterIP</code>: Exposes the Service on a cluster-internal IP. Choosing this value makes the Service only reachable from within the cluster. This is the default ServiceType.</p>
<p><code>NodePort</code>: Exposes the Service on each Node's IP at a static port (the NodePort). A ClusterIP Service, to which the NodePort Service routes, is automatically created. You'll be able to contact the NodePort Service, from outside the cluster, by requesting :.</p>
<p><code>LoadBalancer</code>: Exposes the Service externally using a cloud provider's load balancer. NodePort and ClusterIP Services, to which the external load balancer routes, are automatically created.</p>
<p><code>ExternalName</code>: Maps the Service to the contents of the externalName field (e.g. foo.bar.example.com), by returning a CNAME record</p>
<p>Since you are accessing the POD from outside the kubernetes cluster itself use <code>NodePort</code> or <code>LoadBalancer</code> type service.</p>
