<p>I want to deploy a nginx-server-pod that mounts a directory to serve the files of that directory to my consumer-pod, that also lives on minikube. </p>

<p>In order to start consumer-pod I need to pass the ip of this nginx-server-pod to the configuration files of my-pod <strong>before</strong> it is scheduled or deployed. I do not want to expose nginx-server-pod outside minikube, so I don't want a services that create an external port mapping of type minikube-ip:external-port . I know that internal Cluser-IPs change and cannot be discovered until after the pod is deployed. </p>

<p>Any ideas on how to set an unchanging internal ip for my nginx-server-pod before deployment so I can configure consumer-pod and they can be deployed together?</p>

Aliisa Roe
<p>You should create a <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">service</a> for your nginx container.  It can be a ClusterIP service if it doesn't need to be accessible outside the cluster (or minikube VM).  Once the service exists, it will have a <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/" rel="nofollow noreferrer">DNS name</a> of something like <code>nginx.default.svc.cluster.local</code>.  You can put <em>that</em> in your config file and it will be consistent regardless of what IP address(es) the nginx pod(s) (if any) has.</p>
