<p>I have a K8s, currently running in single node (master+kubelet,172.16.100.81). I have an config server image which I will run it in pod. The image is talking to another pod named eureka server. Both two images are spring boot application. And eureka server's http address and port is defined by me. I need to transfer eureka server's http address  and port to config pod so that it could talk to eureka server.</p>

<p>I start eureka server: ( pesudo code)</p>

<pre><code>kubectl run eureka-server --image=eureka-server-image --port=8761
kubectl expose deployment eureka-server --type NodePort:31000
</code></pre>

<p>Then I use command "docker pull" to download config server image and run it as below:</p>

<pre><code>kubectl run config-server --image=config-server-image --port=8888
kubectl expose deployment config-server --type NodePort:31001
</code></pre>

<p>With these steps, I did not find the way to transfer eureka-server http
server (master IP address 172.16.100.81:31000) to config server, are there 
methods I could transer variable eureka-server=172.16.100.81:31000 to Pod config server? I know I shall use ingress in K8s networking, but currently I use NodePort. </p>

<p>Generally, you don't need nodePort when you want two pods to communicate with each other. A simpler clusterIP is enough.</p>

<p>Whenever you are exposing a deployment with a service, it will be internally discoverable from the DNS. Both of your exposed services can be accessed using:
<code>http://config-server.default:31001</code> and <code>http://eureka-server.default:31000</code>. <code>default</code> is the namespace here.</p>

<p><code>172.16.100.81:31000</code> will make it accessible from <em>outside</em> the cluster.</p>
