-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Custom-Headers annotation not working with 1.10.1 (changes are visible in git tag for 1.10.1) #11339
Comments
/triage accepted Yes true. Line-391 in main
@Gacko maybe the change was not cherry-picked. cc @strongjz @rikatz @tao12345666333 |
@cgroschupp can you confirm test this please |
I'm curious about this. I've looked at the release for 1.10.1, and it doesn't seem to imply that #9742 is bundled with it. Specifically if I visit https://github.com/kubernetes/ingress-nginx/releases/tag/controller-v1.10.1, I don't see the characters "9742" on the page, nor do I see "annotation" What are you seeing that makes you say that the feature is in 1.10.1? |
According to that controller tag the controller image should contain that feature. It seems the controller was not tagged based on release-1.10 branch but instead on main. And also the documentation mentions custom headers. Therefore I thought that should work. |
/assign Will check and follow up. Maybe the cherrypicking to the branch did not happen |
Oh right, I thought you meant that the tag's description (well, release) contains the feature. |
The history of |
I also experienced a problem related to skew between the nginx.tmpl on GitHub vs the container image. I typically grab the nginx.tmpl from the tag on GitHub when updating my manifest to deploy, but after deploying to my staging environment the controller was unable to start due to templating errors: can't evaluate field GeoIP2AutoReloadMinutes in type config.Configuration. I then figured out there was a large drift in the nginx.tmpl from GitHub, vs the nginx.tmpl from the actual container image, which is what I ended up using. Here is the difference between the two:
|
We have the same issue with not matching template from 1.10.1 git tag template with 1.10.1 build. Due to some specific configuration we need custom template in our deployment, so I updated the docker image to version 1.10.1 and updated the template accordingly from the version here on GitHub tag 1.10.1 and now the ingress controller is not able to start because of missing variables to the template.
I'm going to update our custom template accordingly to the version baked in the image and we should be fine for now. However, it would be nice to fix this discrepancy so others don't have the same problem. |
As already pointed out here, this issue is caused by the Git tag being set on the wrong branch. The /close |
@Gacko: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@Gacko I fully understand that this feature was not planned to be integrated into 1.10 as I also wrote at the end of my original message. But still there is a bug in the tagging process that can and will eventually lead to confusion. |
I think the tagging issue only affects v1.10.1, we had some issues with forging that release. Regarding the docs: It has been like this ever since. To fix this, we would need to have docs per tag, atm docs are being published directly from |
@BernhardGruen Was this feature eventually included? I am trying it with 1.11.3 and it isn't working for me. |
@satyamz This feature was released in version 1.11.0 of the controller, so it should be present. |
@pierluigilenoci thanks. Yes, I found it in v1.11.0. However, its still not working as expected. I am checking my configs to see if this is really a bug on my side. |
I am getting following in the logs:
I checked clusterrole and role they do have permission for getting configMap. Also, config itself exists in the default namespace. |
Is the namespace of the configmap the same of ingress resource? |
@rikatz Yes. Both configMap and ingress are in the same namespace. |
I filed a bug here: #12287 I included all information there. Please let me know if I can help you with more information on this. |
I don't see there is a bug here.
|
What happened:
According to the tag controller-1.10.1 the file nginx.tmpl should support the Custom-Headers functionality implemented in #9742. But it does not.
Link to nginx.tmpl in tag controller-1.10.1: https://github.com/kubernetes/ingress-nginx/blob/controller-v1.10.1/rootfs/etc/nginx/template/nginx.tmpl
When comparing with the release-1.10 branch I see that the support is not included there: https://github.com/kubernetes/ingress-nginx/blob/release-1.10/rootfs/etc/nginx/template/nginx.tmpl
Therefore it seems either the tagging process was not working correctly (i.e. tagged based on main) or branch release-1.10 was not updated and was then used as base for the image build process.
What you expected to happen:
I expect that I am able to set custom headers. But as the function is not available in the file nginx.tmpl it basically can't work at all.
NGINX Ingress controller version (exec into the pod and run nginx-ingress-controller --version.):
1.10.1
Kubernetes version (use
kubectl version
):1.28.6
Environment:
does not matter in that case, I believe.
How to reproduce this issue:
Add
global-allowed-response-headers: Content-Type,X-no-meaning
to the config map of the ingress controller.Add an annotation
nginx.ingress.kubernetes.io/custom-headers: custom-headers-configmap
to an ingress.Create said configmap in the same namespace (using
Content-Type: text/json
as data).Test if the header has changed from text/html to text/json.
Anything else we need to know:
I believe the error happened while tagging controller-1.10.1 as it seems to be based of main instead of branch release-1.10.
The release notes of the controller (https://github.com/kubernetes/ingress-nginx/releases/tag/controller-v1.10.1) also do not reference #9742.
Maybe all this only happened because the documentation https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#custom-headers already contains an annotation that will only be present with the next minor release 1.11.0. But I really don't know.
The text was updated successfully, but these errors were encountered: