<p><a href="https://github.com/oussamabouchikhi/udagram-microservices" rel="nofollow noreferrer">Github repo</a></p>
<p>After I configured the <code>kubectl</code> with the AWS EKS cluster, I deployed the services using these commands:</p>
<pre><code>kubectl apply -f env-configmap.yaml
kubectl apply -f env-secret.yaml
kubectl apply -f aws-secret.yaml
# this is repeated for all services 
kubectl apply -f svcname-deploymant.yaml
kubectl apply -f svcname-service.yaml
</code></pre>
<p><a href="https://i.stack.imgur.com/WT9Bn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WT9Bn.png" alt="enter image description here" /></a></p>
<p>The other services ran successfully but the reverse proxy returned an error and when I investigated by running the command <code>kubectl describe pod reverseproxy...</code>
I got this info:</p>
<p><a href="https://pastebin.com/GaREMuyj" rel="nofollow noreferrer">https://pastebin.com/GaREMuyj</a></p>
<p><strong>[Edited]</strong></p>
<p>After running the command <code>kubectl logs -f reverseproxy-667b78569b-qg7p</code> I get this:
<a href="https://i.stack.imgur.com/ixk7s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ixk7s.png" alt="enter image description here" /></a></p>

Oussama Bouchikhi
<p>As <a href="https://stackoverflow.com/users/10008173/david-maze" title="75,885 reputation">David Maze</a> very rightly pointed out, your problem is not reproducible. You haven't provided all the configuration files, for example. However, the error you received clearly tells about the problem:</p>
<pre><code>host not found in upstream &quot;udagram-users: 8080&quot; in /etc/nginx/nginx.conf:11
</code></pre>
<p>This error makes it clear that you are trying to connect to host <code>udagram-users: 8080</code> as defined in file <code>/etc/nginx/nginx.conf</code> on line 11.</p>
<blockquote>
<p>And how can I solve it please?</p>
</blockquote>
<p>You need to check the connection. (It is also possible that you entered the wrong hostname or port in the config).  You mentioned that you are using multiple subnets:</p>
<blockquote>
<p>it is using 5 subnets</p>
</blockquote>
<p>In such a situation, it is very likely that there is no connection because the individual components operate on different networks and will never be able to communicate with each other. If you run all your containers on one network, it should work. If, on the other hand, you want to use multiple subnets, you need to ensure container-to-container communication across multiple subnets.</p>
<p>See also this <a href="https://stackoverflow.com/questions/33639138/docker-networking-nginx-emerg-host-not-found-in-upstream">similar problem</a> with many possible solutions.</p>
