title: Helm - using global values by default
body: <p>I'm new to Helm.</p>
  
  <p>I have a default value in parent chart. I want to use this value in each subchart by default, but also to have a possibility to override the value for a specific subchart.</p>
  
  <p>Example:</p>
  
  <pre><code># Parent-chart values.yaml
  
  global:
    schedule: 10m
  </code></pre>
  
  <p>All the subcharts will use this value by default. But if I run something like this:</p>
  
  <pre><code>helm install --set subchart-A.schedule="20m"
  </code></pre>
  
  <p>Subchart-A will use value "20m".</p>
  
  <p>I'm thinking about two possibilities:</p>
  
  <ol>
  <li>Maybe I can somehow link subchart-value to global value:</li>
  </ol>
  
  <pre><code># Subchart values.yaml
  
  schedule: {{ .Values.global.schedule }} # it doesn't work
  </code></pre>
  
  <p>In that case, it would be possible to override a specific value for the single subchart.</p>
  
  <ol start="2">
  <li>Maybe I can write a function</li>
  </ol>
  
  <pre><code># Pseudocode:
  
  if subchart.schedule is null
    printf global.schedule
  else
    printf subchart.schedule
  </code></pre>
  
  <p>What would you do and what is generally possible?</p>