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

Path in ingress backend is not setting the correct backend in nginx config #1575

Closed
egeland opened this issue Oct 23, 2017 · 4 comments · Fixed by #1605
Closed

Path in ingress backend is not setting the correct backend in nginx config #1575

egeland opened this issue Oct 23, 2017 · 4 comments · Fixed by #1605

Comments

@egeland
Copy link
Contributor

egeland commented Oct 23, 2017

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

nginx ingress path


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

BUG REPORT

When trying to get the nginx ingress to use a different service for a given path, I expect it to generate the backend definition and location config in the nginx config file.
This does not happen.

NGINX Ingress controller version:
0.9.0-beta.13

Kubernetes version (use kubectl version):
Server Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.8", GitCommit:"d74e09bb4e4e7026f45becbed8310665ddcb8514", GitTreeState:"clean", BuildDate:"2017-08-03T18:01:01Z", GoVersion:"go1.7.6", Compiler:"gc", Platform:"linux/amd64"}

Environment:

  • Cloud provider or hardware configuration: AWS
  • Install tools: kops

What happened:

I add another backend to an ingress, to drive traffic for a path to a different service.
When tested, traffic hits the default backend, not the service.

What you expected to happen:

Expected the traffic to go to the configured serviceName on the servicePort, not to hit the default (404) backend.

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

Set up an ingress with config similar to:

spec:
  rules:
  - host: my-hostname.example.com
    http:
      paths:
      - backend:
          serviceName: mainservice
          servicePort: 80
      - path: /otherpath
        backend:
          serviceName: otherservice
          servicePort: 80

Then try to reach the otherservice by hitting my-hostname.example.com/otherpath - you will only reach the upstream-default-backend and get a 404 error.

Anything else we need to know:

The 'otherservice' is an ExternalName Service - as per https://kubernetes.io/docs/concepts/services-networking/service/#services-without-selectors - which appears to be why it's not working as expected

@aledbf
Copy link
Member

aledbf commented Oct 23, 2017

@egeland please check the logs. If you hit the default backend there must be an error with the service

@egeland
Copy link
Contributor Author

egeland commented Oct 23, 2017

I'll double check the logs, presumably the nginx logs, but as I recall from earlier, there's only the 404, from hitting the default back end.
Related to this, I can hit the service direct, and it works just fine.

@egeland
Copy link
Contributor Author

egeland commented Oct 23, 2017

Updated the report to explain that the service is an ExternalName Service

@aledbf
Copy link
Member

aledbf commented Oct 26, 2017

@egeland please use the image quay.io/aledbf/nginx-ingress-controller:0.267

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

Successfully merging a pull request may close this issue.

2 participants