Closed VietND96 closed 1 month ago
Did you try
kube-prometheus-stack:
prometheus:
prometheusSpec:
additionalConfig:
additionalScrapeConfigs:
enabled: true
name: '{{ .Release.Name }}-external-secret'
key: '{{ .Release.Name }}-app-scrape'
@jkroepke, without tpl
it didn't work. Here is error and output
Error: YAML parse error on selenium-grid/charts/kube-prometheus-stack/templates/prometheus/prometheus.yaml: error converting YAML to JSON: yaml: line 85: did not find expected key
helm.go:86: 2024-10-09 02:42:04.299876628 +0000 UTC m=+10.536352312 [debug] error converting YAML to JSON: yaml: line 85: did not find expected key
YAML parse error on selenium-grid/charts/kube-prometheus-stack/templates/prometheus/prometheus.yaml
# Source: selenium-grid/charts/kube-prometheus-stack/templates/prometheus/prometheus.yaml
additionalScrapeConfigs:
name: {{ .Release.Name }}-metrics-exporter
key: {{ .Release.Name }}-selenium-grid
portName: http-web
hostNetwork: false
Please re-check my comment, prometheusSpec.additionalConfig
has tpl.
@jkroepke, oops, my mistake, I was confused about the config key. That config key works now. Thanks! I will close the PR.
What this PR does / why we need it
I am using
kube-prometheus-stack
as a sub-chart. I want to config keyprometheus.prometheusSpec.additionalScrapeConfigsSecret.name
to point to a Secret resource which is created in main chart. The resource name has the prefix is .Release.Name, so I also want to applytpl
. A test is done as belowChart values.yaml
Via
helm template
, the output looks likeWhich issue this PR fixes
(optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged)Special notes for your reviewer
Checklist
[prometheus-couchdb-exporter]
)