<p>I have 2 docker containers, one is running a flask server and the other is running an angular app. When I run both containers on my local system they have no trouble communicating within localhost but when I push these containers into a kubernetes pod, I get the connection refused message. Can anyone please explain what I might be doing wrong within kubernetes? </p>

Jithin Thomas
<ul>
<li><p>containers within the same pod share the same network namespace so there should be no issue for them to communicate over localhost , but anway in this case you should run them on separate pods</p></li>
<li><p>when you run two apps on different pods , they will need to communicate over pod IPs , Or you will need to expose them over service of type ClusterIP, or NodePort or Loadbalancer</p></li>
</ul>

<p>In this case you can run them on separate pods and use cluster DNS service discovery. DNS-based service discovery provides a flexible and generic way to connect to services across the cluster.</p>

<p>Details:</p>

<p><a href="http://kubernetesbyexample.com/sd/" rel="nofollow noreferrer">Kubernetes service discovery by example</a></p>
