1

Github repo

After I configured the kubectl with the AWS EKS cluster, I deployed the services using these commands:

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

enter image description here

The other services ran successfully but the reverse proxy returned an error and when I investigated by running the command kubectl describe pod reverseproxy... I got this info:

https://pastebin.com/GaREMuyj

[Edited]

After running the command kubectl logs -f reverseproxy-667b78569b-qg7p I get this: enter image description here

Wytrzymały Wiktor
  • 11,492
  • 5
  • 29
  • 37
Oussama Bouchikhi
  • 527
  • 1
  • 7
  • 22
  • 1
    That status code means the process inside the pod is exiting, but without knowing anything about what it's doing it's hard to diagnose it any further. Can you edit the question to include a [mcve]? – David Maze Sep 29 '21 at 11:40
  • I do not think `describe pods` can help in this case, the `reason` is `error` so seems like something broken. can you please update the answer by adding `kubectl logs -f reverseproxy-667b78569b-fmswg` – Adiii Sep 29 '21 at 11:41
  • (If that can help) I deployed the secrets first then the reverse proxy (which depends on users and feed) then I deployed feed then users then frontend – Oussama Bouchikhi Sep 29 '21 at 12:28
  • Please avoid using pictures and external services like pastebin. Everything should be pasted here as formatted text. Btw. Which version of Kubernetes did you use and how did you configure your cluster? – Mikołaj Głodziak Sep 29 '21 at 14:06
  • I am using version 1.21 the cluster is publically accessible, it is using 5 subnets and it has a node group of 2 worker nodes of types t3.small with 10GB of size – Oussama Bouchikhi Sep 29 '21 at 15:53
  • the error is clear "host not found in upstream" in the nginx config – Adiii Sep 29 '21 at 16:33
  • And how can I solve it please? – Oussama Bouchikhi Sep 29 '21 at 16:39

1 Answers1

1

As David Maze 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:

host not found in upstream "udagram-users: 8080" in /etc/nginx/nginx.conf:11

This error makes it clear that you are trying to connect to host udagram-users: 8080 as defined in file /etc/nginx/nginx.conf on line 11.

And how can I solve it please?

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:

it is using 5 subnets

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.

See also this similar problem with many possible solutions.

Mikołaj Głodziak
  • 4,775
  • 7
  • 28