ingress-nginx: Enabling dynamic configuration doesnt work with external service
Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT
NGINX Ingress controller version: 0.16.2
Kubernetes version (use kubectl version
):
Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.7", GitCommit:"b30876a5539f09684ff9fde266fda10b37738c9c", GitTreeState:"clean", BuildDate:"2018-01-16T21:59:57Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"8+", GitVersion:"v1.8.7+coreos.0", GitCommit:"768e049ab5230010251f30475e0e785e2e999566", GitTreeState:"clean", BuildDate:"2018-01-18T00:17:18Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"
Environment:
- Cloud provider or hardware configuration:
- OS (e.g. from /etc/os-release):
- Kernel (e.g.
uname -a
): - Install tools:
- Others:
What happened:
Using an externalname service with my configuration worked until I included the --enable-dynamic-configuration flag. Now nginx isnt redirecting to the external service. Its not resolving the upstream host and keeps returning 502 -bad gateway. See snippet of error below
W0717 12:46:10.270803 7 controller.go:773] service foo/fooservice does not have any active endpoints
What you expected to happen: I expect the upstream host to be resolved.
How to reproduce it (as minimally and precisely as possible): Set up an externalName service with no selectors , or endpoints that points to an external service
Anything else we need to know: I believe the issue has to do with the upstream balancer
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 22 (16 by maintainers)
I’ve tracked down “no host allowed” - it’s coming from https://github.com/openresty/lua-nginx-module/blob/master/src/ngx_http_lua_balancer.c
I’ve also found this issue: https://github.com/openresty/lua-resty-core/issues/45
It would appear that currently
--enable-dynamic-configuration
doesn’t supportExternalName
Services as the hostname isn’t resolved in the lua code, or prior to being sent as a backend@gjcarneiro we plan to release 0.18.0 at the end of the week
Edit: In the meantime you can use
quay.io/aledbf/nginx-ingress-controller:0.406
(contains current master)Thanks for extensive debugging @mikebryant. I started working on this at https://github.com/kubernetes/ingress-nginx/pull/2804, hopefully will get it shipped before next week. I’m doing it in Nginx/Lua because we already have a mechanism to periodically process endpoints, I’m piggybacking on it to resolve domain names - that means if DNS changes, Nginx will pick up the change in a second (I think currently you have to reload Nginx), so that’s an added benefit.
Thanks for the very detailed investigation, it’s rare enough to be mentioned 👏