Helm Chart pass variable to dependency

3/26/2021

I'm trying to deploy Grafana using Helm Chart and dependencies but the values don't get passed down to the Grafana chart.

Chart.yaml

apiVersion: v2
appVersion: 7.4.5
name: grafana
dependencies:
- name: grafana
  version: "6.6.4"
  repository: "https://grafana.github.io/helm-charts"
version: 6.6.4

Values.yaml

grafana:
  persistence.enabled: true
  persistence.size: 5Gi

I want to enable persistence by overwriting the persistence.enabled variable (which is set to false by default) with true. I tried doing with helm install grafana . --set persistence.enabled=true but nothing happens either, it's always the same deployment.

Edit: I tried this method https://stackoverflow.com/questions/49580938/helm-overriding-chart-and-values-yaml-from-a-base-template-chart but it didn't work for me. Maybe it's my fault for not understanding how to do it.

-- Arv1nt3
kubernetes
kubernetes-helm

1 Answer

3/26/2021

Please Change below in your values yaml

From

grafana:
  persistence.enabled: true
  persistence.size: 5Gi

To

grafana:
  persistence:
    enabled: true
    size: 5Gi

Please always use the default values yaml from helm chart https://github.com/grafana/helm-charts/blob/main/charts/grafana/values.yaml as reference of what your values yaml should contain.

Command Line command will be

helm install grafana . --set grafana.persistence.enabled=true --set grafana.persistence.size=5Gi
-- Sagar Velankar
Source: StackOverflow