kubernetes - nginx ingress controller - upstream timed out (110: Operation timed out) while connecting to upstream from another namespace

11/24/2021

I am trying to fix this issue:

2021/11/24 14:28:46 error 610#610: *64890 upstream timed out (110:Operation timed out) while connecting to upstream, client: 172.31.30.204, server: _, request: "GET /user/list HTTP/1.1", upstream: "http://10.111.78.149:8080/list", host: "3.142.236.87:30080"

I did tried to get inside the nginx-ingress-controller pod and execute this command:

curl 10.111.78.149:8080/list

10.111.78.149 - usertest service CLUSTER-IP

Received this error:

curl: (28) Failed to connect to 10.111.78.149 port 8080 after 131181 ms: Operation timed out

On the other namespace (demo), I also did try to use the said command inside the pod:

curl 10.111.78.149:8080/list

Had the expected response:

{"message":"User list","users":{"name":"Jon Snow"},{"name":"Frodo Baggins"},{"name":"Bilbo Baggins"}}

The service usertest service belong in the demo namespace

Am I missing something here?

Edit here is the service.yaml:

apiVersion: v1
kind: Service
metadata:
  annotations:
    meta.helm.sh/release-name: user-app-nginx-ingress
    meta.helm.sh/release-namespace: default
  creationTimestamp: "2021-11-24T14:27:39Z"
  labels:
    app.kubernetes.io/instance: user-app-nginx-ingress
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: nginx-ingress
    app.kubernetes.io/version: 1.16.0
    helm.sh/chart: nginx-ingress-0.1.0
  name: usertest
  namespace: demo
  resourceVersion: "1553814"
  uid: 266b7fc7-6fdb-455b-acfd-e4ba110460ec
spec:
  clusterIP: 10.111.78.149
  clusterIPs:
  - 10.111.78.149
  internalTrafficPolicy: Cluster
  ipFamilies:
  - IPv4
  ipFamilyPolicy: SingleStack
  ports:
  - name: http
    port: 8080
    protocol: TCP
    targetPort: 8080
  selector:
    app.kubernetes.io/instance: user-app-nginx-ingress
    app.kubernetes.io/name: nginx-ingress
  sessionAffinity: None
  type: ClusterIP
status:
  loadBalancer: {}
-- thegreatduke
kubernetes
nginx

0 Answers