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
gRPC call via nginx ingress missing metadata #5366
Comments
Your issue seems to be that your custom headers are not passed to the application by the nginx proxy (ingress controller). The issue is not directly related to gRPC, it's just related to the nginx proxy configuration. You have several options to fix it: 1) Pass the custom headers using ingress annotationsTo add those custom headers you can use the annotation "nginx.org/proxy-pass-headers" (more info here: https://docs.nginx.com/nginx-ingress-controller/configuration/ingress-resources/advanced-configuration-with-annotations/#request-uri-header-manipulation) 2) Pass the custom headers using a configmapAnother approach is to configure the nginx ingress controller via a ConfigMap to pass a custom list of headers to the upstream server: https://kubernetes.github.io/ingress-nginx/examples/customization/custom-headers/ 3) Set the custom headers from the ingress resourceYou can see an example here: https://linkerd.io/2/tasks/using-ingress/#nginx |
Thank you @leonjalfon1 , but this did not resolved the issue,
nginx set the header as invalid due to the "_" and does not pass it forward.. Thanks for the help! |
Thanks a lot! That help me with the issue. |
Hi,
I've been struggling with this for couple of days now,
while using nginx-ingress with http\https calls i was able to get all the http headers been passing trough the nginx-ingress-controller (just did a simple post and echo the received headers)
But while using gRPC calls and supplying a metadata as following (using bloomRPC) :
{"test_header":"value123"}
I'm unable to receive it in the pod side. the flow works but all metadata (aka headers) are gone, Is there a special configuration needed to forward the metadata via the nginx-ingress-controller?
using the same call directly to pod with nodeport works and all metadata is valid.
and if there is no special option i should activate, is there a way to debug this in the controller side? i can only see the calls in the log but not the headers.
i'm using the following ingress service yml (Rancher2)(Image: rancher/nginx-ingress-controller:nginx-0.25.1-rancher1)
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
field.cattle.io/creatorId: u-zmb65
field.cattle.io/ingressState:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/backend-protocol: GRPC
nginx.ingress.kubernetes.io/ssl-redirect: "true"
creationTimestamp: "2020-04-07T13:47:11Z"
generation: 1
labels:
cattle.io/creator: norman
name:
namespace: ingress-test
resourceVersion: "1950374"
selfLink:
uid: 0ecb2cc1-8fe9-474b-8d37-863a2e5c8f8d
spec:
rules:
http:
paths:
serviceName:
servicePort:
path: /
tls:
status:
loadBalancer:
ingress:
Thanks a lot
The text was updated successfully, but these errors were encountered: