<p>I have created a kubernetes cluster on Azure. I have deployed some pods where there is no frontend (micro services).</p>

<p>I have performed tests locally using Postman and VS Code: these micro services return either 200 O` or 500.</p>

<p>The problem is that in Kubernetes I have the external IP correctly, but it is impossible for me to access from outside.</p>

<p>I have another Mongo container that I can access without problems.I leave some images to try to solve:</p>

<p><a href="https://i.stack.imgur.com/kwO7U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kwO7U.png" alt="enter image description here"></a>
<a href="https://i.stack.imgur.com/EdYiz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EdYiz.png" alt="enter image description here"></a></p>

<p>Can you help me? thanks!!</p>

llopezt
<p>Kubernetes is a little bit more complex than simple docker containers, so it might get confusing to get it running at first. I will explain at which points you need to configure exposure of a service.</p>

<p>Each container has an own ip address space, so each container can use the same port for an application. In your case you might want to use port 6060. This is the port the application needs to bind to and on all network interfaces (ip 0.0.0.0) to be reachable from the outside. This is the port you would declare as EXPOSE in your dockerfile.</p>

<p>When testing locally you can map each container to a different <strong>local</strong> port for testing: <code>docker run -p external-port:internal-port</code></p>

<p>The port you use for EXPOSE is the port you configure as <code>containerPort</code> in a Pod or Deployment.</p>

<p>One or many pods are exposed as load balanced service inside kubernetes using a Service. There you might want to map a request port - for http usually 80 - to the container port, in your case 6060.</p>

<p>The service can then be exposed externally using a LoadBalancer. The external IP of the LoadBalancer will be mapped to the (virtual IP) of your Service, the Service maps the request port to the container port and selects an appropriate pod using the selector. The pod contains a container listening on the container port and then replies to your request.</p>

<p>The whole chain must be configured correctly in order to get it working. Keeping it simple (not using different ports for each application) makes it easier to get right.</p>
