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

Bad ingress annotation crashes all nginx-controllers once restarted #3965

Closed
garyhuang123 opened this issue Apr 5, 2019 · 1 comment
Closed

Comments

@garyhuang123
Copy link

garyhuang123 commented Apr 5, 2019

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/.): NO

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

NGINX Ingress controller version:
0.16.2

Kubernetes version (use kubectl version):
1.11.5

Environment:

  • Cloud provider or hardware configuration: On-premise VMware
  • OS (e.g. from /etc/os-release): CentOS Linux release 7.5.1804 (Core)
  • Kernel (e.g. uname -a): Linux 3.10.0-957.5.1.el7.x86_64
  • Install tools: rancher
  • Others: rancher 2.1.3

What happened:

When user put '$' sign into ingress annotations,

  • If nginx-controller is already running, it does not crash. As it rejects to reload with bad rules. But all of the future coming healthy rules are all rejected.
  • If nginx-controller restarts, it fails to reload all rules when there are bad things (like, with ${variable}) in there. The /etc/nginx/nginx.conf becomes with no upstreams and /healthz location. Then Kubernetes probes pod is unhealthy with no /healthz location served. So it kills nginx-contoller and tries to restart it. But that repeats because of the continuous conf syntax check failure. And finally all nginx-controllers fall into the crashloopbackoff state.

What you expected to happen:

Nginx-controller should be as robust/stable enough as a gateway. Shouldn't be that easy to crash.

  • If there are illegal signs inside ingress annotations, it should be rejected before applying into Kubernetes
  • Even if there are some bad rules generated from ingress specs, nginx-controller should be able to filter them out and discard them, also should log down what rules are discarded for track.
  • If there are bad rules there, nginx-controller should not just ignore all of the future good ones.

How to reproduce it (as minimally and precisely as possible):

  1. Put ${variable} into the Ingress annotations, like,
    ‘nginx.ingress.kubernetes.io/upstream-vhost: mc.${teamServer}.dev.com’

    image

  2. Delete nginx-controller pods, so Kubernetes will create new ones, and you'll find all pods fail with below log
    image

@aledbf, @ElvinEfendi

@aledbf
Copy link
Member

aledbf commented Apr 5, 2019

Closing. Duplicated #3588

@aledbf aledbf closed this as completed Apr 5, 2019
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