-
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
Add annotation to allow use of service ClusterIP for NGINX upstream. #981
Conversation
@aledbf I see there is a good amount of activity around NGINX ingress and configuration reloads for upstream changes (kubernetes-retired/contrib#1140), hopefully this change is worth exploring. I'm not sure when ingress development started but now |
Coverage decreased (-0.2%) to 44.104% when pulling 70753b978007721290dc8dc3739a655cb72025d6 on chrismoos:service_upstream into 82e75ee on kubernetes:master. |
@chrismoos kube-proxy is executed every ~100ms. |
@chrismoos I really don't like this because introduces another variable (kube-proxy). |
@aledbf I'll document the annotation with a warning that sticky sessions will not work. As for the retries -- I believe it will still exhibit the same retry logic (but instead against only 1 upstream, which will just cause another random pod to be selected via iptables), see: https://forum.nginx.org/read.php?2,152071,152136#msg-152136 I'm personally not too worried about adding I don't mind providing support on this one. |
70753b9
to
525570e
Compare
@aledbf Updated documentation with warning about sticky sessions. |
@chrismoos one small change. Add a mention that in case of errors, no retries will be made because there is only one server in the nginx upstream. |
Coverage decreased (-0.2%) to 44.026% when pulling 525570eb3f6f63ed04614865b108b7db75c4dd06 on chrismoos:service_upstream into bfd60ac on kubernetes:master. |
525570e
to
666bcca
Compare
@aledbf Done. Documentation has been updated w/ those issues pointed out. |
/lgtm |
@chrismoos thanks! |
When I use the annotation I still see all the Pod IPs as endpoints. Shouldn't I see the Service's ClusterIp? I see this:
|
This change adds a new annotation
ingress.kubernetes.io/service-upstream
that when set to true, uses a service's Cluster IP and port as the single upstream server, rather than the full list of service endpoints. This may address #257.There are now no NGINX configuration reloads necessary when a service's pods come and go.
This helps with things like zero-downtime deployments and other issues arising from NGINX configuration reloads for upstream server changes.