-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Empty $service_name and $service_port variables #5198
Comments
@praseodym please check the ingress controller pod log. |
You're right, it should be |
@praseodym please post the pod logs. If that is empty, something should appear there. |
Please see the ingress-nginx pod logs with --v=2. |
@praseodym are you using the sample ingress definition? (or did you create an ingress without host field?) |
I created an ingress object without a host field (the definition in the first post is the full object I applied). |
Adding a apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: emojivoto
namespace: emojivoto
annotations:
nginx.ingress.kubernetes.io/configuration-snippet: |
proxy_set_header l5d-dst-override $service_name.$namespace.svc.cluster.local:$service_port;
spec:
rules:
- host: localhost
http:
paths:
- backend:
serviceName: web-svc
servicePort: 80
path: / gives:
While it isn't too common to not have a |
This is a bug, I am just trying to narrow where is located. |
@praseodym please test |
This fixes the problem, thank you! |
Thanks from the Linkerd team, @aledbf! |
@aledbf We are still running into this problem. Namely, I have the following resource:
I find the |
@zaharidichev thank you for the report. I will open a PR to fix this issue. That said, what's the use case for an ingress without a host field? I asked because, without that field, paths cannot be repeated, and accessing an ingress controller by an IP address is not the "correct" approach. |
We are having a similar problem even if we have specified the host variable like below. So while using below ingress we get "set $service_name ""; " in the nginx.conf ( so a empty service_anme) and if I remove annotation "nginx.ingress.kubernetes.io/rewrite-target: /" then it works fine and I get "set $service_name "API";"
Is this something you could have a look at? |
I stumble upon this while debugging the linkerd annotations for ingress. It seems not that I'm using controller version |
NGINX Ingress controller version: 0.30.0
Kubernetes version (use
kubectl version
): v1.17.2 in kindWhat happened:
I am trying to get Linkerd to work with ingress-nginx. Linkerd provides instructions for this, the important annotation to add to the Ingress object being:
This didn't work as expected, and I traced this down to the
$service_name
and$service_port
variables not being filled as expected:What you expected to happen:
The
$service_name
variable being set toweb-svc
and the$service_port
variable being set to80
.How to reproduce it:
Install the emojivoto sample application and apply the following Ingress object:
Then use the ingress-nginx kubectl plugin to check the nginx config (
kubectl ingress-nginx conf | grep -C4 service_name
).Anything else we need to know:
/kind bug
The text was updated successfully, but these errors were encountered: