<p>I just tried setting up kubernetes on my bare server,</p>

<p>Previously I had successfully create my docker compose</p>

<p>There are several apps :</p>

<ul>
<li>Apps A (docker image name : a-service)</li>
<li>Apps B (docker image name : b-service)</li>
</ul>

<p>Inside Application A and B there are configs (actually there are apps A,B,C,D,etc lots of em)</p>

<p>The config file is something like this</p>

<pre><code>IPFORSERVICEA=http://a-service:port-number/path/to/something
IPFORSERVICEB=http://b-service:port-number/path/to/something
</code></pre>

<p>At least above config work in docker compose (the config is inside app level, which require to access another apps). Is there any chance for me to access another Kubernetes Service from another service ? As I am planning to create 1 app inside 1 deployment, and 1 service for each deployment.</p>

<p>Something like:</p>

<pre><code>App -&gt; Deployment -&gt; Service(i.e: NodePort,ClusterIP)
</code></pre>

<p>Thanks !</p>

thegexploit
<p>Use Kubernetes <a href="https://kubernetes.io/docs/concepts/services-networking/service/#discovering-services" rel="nofollow noreferrer">service discovery</a>.</p>

<blockquote>
  <p>Service discovery is the process of figuring out how to connect to a
  service. While there is a service discovery option based on
  environment variables available, the DNS-based service discovery is
  preferable. Note that DNS is a cluster add-on so make sure your
  Kubernetes distribution provides for one or install it yourself.</p>
</blockquote>

<p><a href="http://kubernetesbyexample.com/sd/" rel="nofollow noreferrer">Service dicovery by example</a></p>
