-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Ingress Controller randomly referencing deleted services causing 503's #2302
Comments
@jeffutter the behavior you see is expected.
This is what happens behind the scenes:
The issue here is the change in the upstreams. You are using a different one each time you change from blue to green. What you should do is to use the same service and change the selector. This only changes the upstream servers in nginx. |
@aledbf Thanks for the quick response. I would maybe expect a little blip right at the time of the cut-over from nginx restarting. However, I'm seeing these errors more than 24 hours after cutting over. I don't think that should be expected? Also, |
No
Yes but the name of the upstream (nginx section) is related to the k8s service name
No if you don't use websockets or keepalive connections. If that's the case this feature avoids nginx reloads. |
Closing. Please update to 0.14.0 and reopen if the issue persist |
NGINX Ingress controller version:
Kubernetes version:
Environment:
I think our setup is important to know to understand the issue. We are using the nginx-ingress to do blue/green deployments. Here are the components involved:
Deployments:
• web-a-blue
• web-b-blue
• web-a-green
• web-b-green
Services:
• web-a-blue-svc
• web-b-blue-svc
• web-a-green-svc
• web-b-green-svc
Ingress:
• master-ingress (serves
(a|b).ourdomain.com
)• web-a-blue-ingress (serves
a.blue.ourdomain.com
)• web-b-blue-ingress (serves
a.blue.ourdomain.com
)• web-a-green-ingress (serves
a.green.ourdomain.com
)• web-b-green-ingress (serves
b.green.ourdomain.com
)We do blue/green as follows:
• Deploy
web-*-blue
deployments andweb-*-blue-svc
• Update
master-ingress
to point toweb-*-blue-svc
When cutting over:
• Deploy
web-*-green
deployments andweb-*-green-svc
• Update
master-ingress
to point toweb-*-green-svc
• Wait a bit
• Delete
web-*-blue
deployments andweb-*-blue-svc
What happened:
I am occasionally seeing requests be returned as 503 errors. In the logs from the
ingress-controller
, I am seeing some strangeness around the 503.Here are the logs from the ingress controller, collected over 24 hours after the last switch from blue -> green:
It seems like the
nginx-ingress
is retaining some reference toweb-*-blue-svc
even though that resource has been destroyed. Dumping thenginx.conf
doesn't show any reference toblue
at all, although I may not be dumping it at the correct time to catch it.I'm also not sure if the 503 is happening because it's actually trying to send it to the backends for the
web-*-blue-svc
s or if it is because nginx is restarting, and hasn't fully started back up yet.What you expected to happen: After cutting over which service the
master-ingress
points to, I wouldn't expect thenginx-ingress
to referenceweb-blue
at all, and I would not expect it to get 503'sHow to reproduce it (as minimally and precisely as possible): We can reproduce it on our infrastructure by deploying the deployments and services, switching over in the ingress and deleting the old deployments and services.
Anything else we need to know: Please let me know if there is any more information I can gather to help debug.
The text was updated successfully, but these errors were encountered: