Comments (13)
@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.
Also the official documentation https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#custom-headers already mentions custom-headers
. Maybe the documentation should be based on the current stable branch instead of an unreleased branch.
from ingress-nginx.
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.
I0513 12:11:35.449450 8 controller.go:190] "Configuration changes detected, backend reload required"
E0513 12:11:35.452153 8 controller.go:205] Unexpected failure reloading the backend:
template: nginx.tmpl:334:17: executing "nginx.tmpl" at <$cfg.GRPCBufferSizeKb>: can't evaluate field GRPCBufferSizeKb in type config.Configuration
E0513 12:11:35.452208 8 queue.go:131] "requeuing" err="template: nginx.tmpl:334:17: executing \"nginx.tmpl\" at <$cfg.GRPCBufferSizeKb>: can't evaluate field GRPCBufferSizeKb in type config.Configuration" key="luft-system/kube-state-metrics-cgpjj"
I0513 12:11:35.452339 8 event.go:364] Event(v1.ObjectReference{Kind:"Pod", Namespace:"luft-system", Name:"ingress-nginx-controller-7c4986467-v8w6c", UID:"b38b633e-482b-4609-a327-eb451cc0c1c7", APIVersion:"v1", ResourceVersion:"531509399", FieldPath:""}): type: 'Warning' reason: 'RELOAD' Error reloading NGINX: template: nginx.tmpl:334:17: executing "nginx.tmpl" at <$cfg.GRPCBufferSizeKb>: can't evaluate field GRPCBufferSizeKb in type config.Configuration
I0513 12:11:38.686242 8 sigterm.go:36] "Received SIGTERM, shutting down"
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.
from ingress-nginx.
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 main
branch. @longwuyuan, can you come up with a solution for that?
from ingress-nginx.
/triage accepted
/priority important-soon
Yes true.
Line-391 in main
seems different from same line-391 in branch release-1-10@Gacko maybe the change was not cherry-picked. cc @strongjz @rikatz @tao12345666333
from ingress-nginx.
@cgroschupp can you confirm test this please
from ingress-nginx.
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.
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?
from ingress-nginx.
According to that controller tag the controller image should contain that feature.
https://github.com/kubernetes/ingress-nginx/blob/controller-v1.10.1/rootfs/etc/nginx/template/nginx.tmpl
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.
from ingress-nginx.
/assign
Will check and follow up. Maybe the cherrypicking to the branch did not happen
from ingress-nginx.
According to that controller tag the controller image should contain that feature. https://github.com/kubernetes/ingress-nginx/blob/controller-v1.10.1/rootfs/etc/nginx/template/nginx.tmpl
Oh right, I thought you meant that the tag's description (well, release) contains the feature.
Yeah, something is up with the 1.10.1 tag and branch, it looks like they diverged for some reason.
from ingress-nginx.
The history of rootfs/etc/nginx/template/nginx.tmpl
for https://github.com/kubernetes/ingress-nginx/blob/release-1.10/rootfs/etc/nginx/template/nginx.tmpl vs https://github.com/kubernetes/ingress-nginx/blob/controller-v1.10.1/rootfs/etc/nginx/template/nginx.tmpl is definitely different.
from ingress-nginx.
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:
cperson@THINKPAD:~/Downloads/ingress-nginx-v1.10.1$ curl -sSL https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.10.1/rootfs/etc/nginx/template/nginx.tmpl > nginx_from_github_tag_v1.10.1.tmpl
cperson@THINKPAD:~/Downloads/ingress-nginx-v1.10.1$ docker run --rm registry.k8s.io/ingress-nginx/controller:v1.10.1 cat /etc/nginx/template/nginx.tmpl > nginx_from_image_tag_v1.10.1.tmpl
cperson@THINKPAD:~/Downloads/ingress-nginx-v1.10.1$ diff nginx_from_github_tag_v1.10.1.tmpl nginx_from_image_tag_v1.10.1.tmpl
175,177d174
< {{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
< auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
< {{ end }}
189,191d185
< {{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
< auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
< {{ end }}
203,205d196
< {{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
< auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
< {{ end }}
229,231d219
< {{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
< auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
< {{ end }}
255,257d242
< {{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
< auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
< {{ end }}
265,267d249
< {{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
< auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
< {{ end }}
275,277d256
< {{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
< auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
< {{ end }}
292,294d270
< {{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
< auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
< {{ end }}
334,337d309
< {{ if gt $cfg.GRPCBufferSizeKb 0 }}
< grpc_buffer_size {{ $cfg.GRPCBufferSizeKb }}k;
< {{ end }}
<
1490,1496d1461
< {{ end }}
<
< {{ if $location.CustomHeaders }}
< # Custom Response Headers
< {{ range $k, $v := $location.CustomHeaders.Headers }}
< more_set_headers {{ printf "%s: %s" $k $v | escapeLiteralDollar | quote }};
< {{ end }}
cperson@THINKPAD:~/Downloads/ingress-nginx-v1.10.1$
from ingress-nginx.
As already pointed out here, this issue is caused by the Git tag being set on the wrong branch. The release-1.10
branch the image was built and the release was forged from does not contain this feature, as we are not releasing new features but only patches on an existing minor release.
/close
from ingress-nginx.
@Gacko: Closing this issue.
In response to this:
As already pointed out here, this issue is caused by the Git tag being set on the wrong branch. The
release-1.10
branch the image was built and the release was forged from does not contain this feature, as we are not releasing new features but only patches on an existing minor release./close
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.
from ingress-nginx.
Related Issues (20)
- Text Streaming not working when using Nginx-Ingress on Kubernetes HOT 7
- doc error about traffic mirror HOT 3
- Helm: Use OCI-based registries HOT 8
- removing ingress Nginx default résponse header HOT 11
- py-lmdb CVE-2019-16224, CVE-2019-16225, CVE-2019-16226, CVE-2019-16227 HOT 8
- Convert multiple path rewrite rules from default.conf to ingress-nginx.yaml HOT 15
- Usage of GeoIP2 variables CRASH the ingress in case maxmind-license is out of download quota (or download fails) HOT 6
- Support per-ingress opentelemetry service naming HOT 2
- GeoIP2 files present in /etc/ingress-controller/geoip, but the controller logs show "GeoLite2-City.mmdb not found" HOT 5
- Route53 DNS problems HOT 6
- tls: failed to verify certificate: x509 HOT 4
- ginkgo bump requirement reported in CI e2e HOT 3
- Add annotation for per-Ingress upstream-keepalive-connections HOT 3
- Vulnerability CVE-2023-44487 in NGINX 1.21.6 reported for controller-v1.9.6 HOT 7
- ingress-nginx chart + terraform = Invalid value: "integer": spec.triggers[1].metadata.value in body must be of type string: "integer" HOT 8
- Possibility to customize the format of error logs and controller logs HOT 2
- GRPCBufferSizeKb Templating Error on 1.10.1 HOT 4
- AWS nginx-ingress-controller context error HOT 5
- Race condition during SNI extraction when TLS ClientHello is fragmented leading to ssl-passthrough being "ignored" HOT 3
- Public IP of Ingress-nginx is not accessible for CAPZ in v1.29.1 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ingress-nginx.