Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating ingress causes 504/502 error #3903

Closed
rajeshkodali opened this issue Mar 18, 2019 · 10 comments
Closed

Creating ingress causes 504/502 error #3903

rajeshkodali opened this issue Mar 18, 2019 · 10 comments

Comments

@rajeshkodali
Copy link

Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see https://kubernetes.io/docs/tasks/debug-application-cluster/troubleshooting/.):

What keywords did you search in NGINX Ingress controller issues before filing this one? (If you have found any duplicates, you should instead reply there.):


Is this a BUG REPORT or FEATURE REQUEST? (choose one):

NGINX Ingress controller version:
0.2.1

Kubernetes version (use kubectl version):
1.11.7

Environment:

  • Cloud provider or hardware configuration:
    AWS
  • OS (e.g. from /etc/os-release):
    Debian
  • Kernel (e.g. uname -a):
    SMP Debian 4.9.110-3+deb9u2 (2018-08-13) x86_64 GNU/Linux
  • Install tools:
  • Others:

What happened:
Create new ingress rule, and new pods come up terminating old ones and cause 504 on cluster and 502 for a minute

What you expected to happen:

Dynamic reload without pod restarts or recreate

How to reproduce it (as minimally and precisely as possible):
Create and change ingress rules and apply

Anything else we need to know:

@aledbf
Copy link
Member

aledbf commented Mar 18, 2019

Create new ingress rule, and new pods come up terminating old ones and cause 504 on cluster and 502 for a minute

Are you using probes in your application deployments?

@aledbf
Copy link
Member

aledbf commented Mar 18, 2019

Also, please check https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#proxy-next-upstream like proxy-next-upstream: error timeout http_502 http_504

@rajeshkodali
Copy link
Author

Yes, I do use liveness and readiness checks on the application. Is it by design to create new pods on ingress changes?

@aledbf
Copy link
Member

aledbf commented Mar 18, 2019

Is it by design to create new pods on ingress changes?

What do you mean?

@rajeshkodali
Copy link
Author

rajeshkodali commented Mar 18, 2019 via email

@aledbf
Copy link
Member

aledbf commented Mar 18, 2019

I mean is ingress deployment suppose to create/re-create new pods on
applying ingress changes?

There is no pod/s creation when you create/change ingresses or any other scenario, the ingress controller only reaches the API server to sync the changes in the cluster.

What are you doing exactly?

@rajeshkodali
Copy link
Author

rajeshkodali commented Mar 18, 2019 via email

@aledbf
Copy link
Member

aledbf commented Mar 18, 2019

@rajeshkodali first, please update to 0.23.0. After that please check https://kubernetes.github.io/ingress-nginx/examples/rewrite/#rewrite-target

@aledbf
Copy link
Member

aledbf commented Mar 18, 2019

Your rule should look something like

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: nginx-api-regex-rules
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$1
    # without a TLS section, this does nothing
    # nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
  rules:
  - host: ZZZZZZZZZZ
    http:
      paths:
      - backend:
          serviceName: server
          servicePort: http
        path: /.*/api/(.*)

@rajeshkodali
Copy link
Author

I wish I can upgrade, I was having issues with 308 redirects on 0.22/0.23 . I couldn't try the fix mentioned in #2724 yet. I may have to live to 0.21 for a bit until it's tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants