-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Ingress not working when kubernetes.io/ingress.class used #2349
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
Comments
It seems like the backend has 1 endpoint and the location is added properly, so the ingress class matches:
Could you attach the generated nginx config? (/etc/nginx/nginx.conf) |
@antoineco here is the nginx config
|
Thanks @Narayanprusty, looking into this. |
I'm seeing the same issue with the latest stable chart (nginx-ingress-0.18.0). When I specify something like
When I remove the custom ingressClass, everything works as expected. |
@ralphrodkey that's a different issue, you created your Ingress object without setting the corresponding ingress class annotation.
The class set in the controller and in the Ingress objects must match. In your case: |
@Narayanprusty I tried to reproduce this without success. I think either your backend was not ready and NGINX returned a 502, or the backend itself returned that error. Besides the I started a controller with apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-issue2349
annotations:
kubernetes.io/ingress.class: foo
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:
- backend:
serviceName: echoheaders
servicePort: 80
path: /jsonRPC Works like a charm: $ curl -kL http://localhost/jsonRPC
Hostname: echoheaders-5d8965b6cc-lj5z5
(...) $ curl -kL http://localhost/
default backend - 404 I suggest you give it another try on the latest I believe this can be closed, ping @aledbf. |
Agree with @antoineco. Closing. @Narayanprusty when open an issue please send the stored yaml object and not a template, that way is a lot easier for us try to replicate the setup. |
@antoineco Sorry, I can see that I didn't mention that I was updating the annotation on my deployment to match what the ingress controller was expecting. This fails:
This works:
|
@ralphrodkey the annotation must be set on the |
Well, there's nothing like an embarrassingly public mistake to keep you humble. Thanks, @antoineco. It works exactly as expected when you do it the right way. |
Glad it helped! 👍 |
NGINX Ingress controller version:
NGINX Ingress Controller version: 0.12.0
Kubernetes version (use
kubectl version
):What happened:
I want to have multiple ingress controllers. Each pointing to a different backend service. I am trying to use kubernetes.io/ingress.class class annotation but it's giving 502 error. If I remove kubernetes.io/ingress.class then it works all fine.
Here is my deployment file:
And here is my ingress:
Here is the logs:
I am making request to /jsonRPC and it's giving 502. I don't see anything wrong in the logs.
The text was updated successfully, but these errors were encountered: