Skip to content

Render podAnnotations with tpl so the scrape port follows http_listen_port - #700

Merged
kd7lxl merged 1 commit into
cortexproject:masterfrom
cvas22:feat/410-tpl-pod-annotations
Nov 20, 2026
Merged

kd7lxl merged 1 commit into
cortexproject:masterfrom
cvas22:feat/410-tpl-pod-annotations

Conversation

@cvas22

@cvas22 cvas22 commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

What this PR does:

The podAnnotations of every component now go through tpl, as kd7lxl suggested in the issue, and the default prometheus.io/port: '8080' annotations are now '{{ .Values.config.server.http_listen_port }}'. Changing the listen port then changes the scrape port too, instead of leaving the pods annotated with 8080. With the defaults the rendered output is the same as before. The ones that use the http-metrics port name were already fine and aren't changed.

Users can now reference other values in their own pod annotations too, which also means a literal {{ in an annotation value would get templated now.

Which issue(s) this PR fixes:
Fixes #410

Checklist

  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX], [DEPENDENCY]

…_port

Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
@kd7lxl
kd7lxl merged commit fb6fbff into cortexproject:master Nov 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Changing http_listen_port doesn't change ServiceMonitor podAnnotations values

2 participants