In a helm chart, I want to access one of the dependencies’ values in my parent chart.
apiVersion: v2
name: hajhosein-kube-prom
description: A Helm chart for Kubernetes
# The version of the parent chart
version: 0.1.0
# The version of Helm required to use this chart
appVersion: "1.16.0"
# Add the kube-prometheus-stack chart as a dependency
dependencies:
- name: kube-prometheus-stack
version: "61.3.1"
repository: "https://prometheus-community.github.io/helm-charts"
And my values.yaml file is something like this:
kube-prometheus-stack:
prometheus:
thanosService:
enabled: false
thanosRuler:
enabled: false
prometheus:
thanosService:
enabled: true
...
In my parent templates I want to use a file from the dependency and change some of its properties(they can not be changed by modifying values). I have copied this file to templates/prometheus/ path of my chart’s root.
When running helm template --dry-run hajoveis-chart ./
I get this:
Error: template: hajhosein-kube-prom/templates/prometheus/serviceThanosSidecar.yaml:20:14: executing "hajhosein-kube-prom/templates/prometheus/serviceThanosSidecar.yaml" at <.Values.prometheus.thanosService.ipDualStack.enabled>: nil pointer evaluating interface {}.enabled
These values are generated in the dependency’s template. I want to somehow access them in my current chart.
Hosein abootaleb is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
I tried this: .Values.kube-prometheus-stack… but got error Error: parse error bad character U+002D ‘-‘ . Then I used this: index .Values “kube-prometheus-stack” “prometheus” and everything got fixed. –
Hosein abootaleb is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.