<p>I have two simple applications that I have to deploy in Minikube on two different pods. The two applications must communicate via REST calls, so I need an IP address. How can I create a Minikube pod that I can reach locally via a hostname such as <a href="http://name:port" rel="nofollow noreferrer">http://name:port</a> without writing the IP address?</p>

rfivbiiz
<p>the Kubernetes-Approach would be adding an <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">Service-Layer</a> around the Pods (the instances) of your application. To do this, write a YAML-Spec like this:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: my-service
spec:
  selector:
    app: MyApp # &lt;&lt; Replace with a matching Label
  ports:
  - protocol: TCP
    port: 80
    targetPort: # &lt;&lt; Replace with a matching Port
</code></pre>

<p>After you applied your changes <code>kubectl apply -f &lt;FILENAME&gt;</code>, you can access all services fulfilling the specified label-selector across all namespaces inside your cluster by calling this DNS-Name: <code>my-service.&lt;NAMESPACE&gt;.svc</code></p>
