<p>I'm using helm 2.16. I have a chart with this structure:</p>

<pre><code>umbrella
  |-charts
      |-subchart1
      |-subchart2
</code></pre>

<p>I want to be able to install umbrella chart + subchart1 <em>or</em> umbrella chart + subchart2 by using a single flag (subchart1 or subchart2) and have a default for that flag as subchart1.</p>

<p>As helm chart conditions on requirements cannot be negated, are there any other solutions available other that guarding all the resources from one of the charts with IFs ?</p>

Laurentiu Soica
<p>A workaround that I have found is to place all the subcharts into a subchart folder and have the <code>requirements.yaml</code> configuration file similar to below:</p>

<pre><code>dependencies:
  - name: subchart1
    version: example-version
    repository: "subchart1-directory"
    alias: postgresql
    condition: subchart1.enabled
  - name: subchart2
    version: example-version
    repository: "file://subcharts/subchart2"
    condition: subchart2.enabled
</code></pre>

<p>and in <code>values.yaml</code>, add</p>

<pre><code>subchart1:
  enabled: true    
subchart2:
  enabled: false
</code></pre>

<p>Then during installation, pass the values to enabled or disable the subchart1 as follows:</p>

<pre><code>$ helm install --set subchart1.enabled=true
</code></pre>

<p>or</p>

<pre><code>$ helm install --set subchart1.enabled=false
</code></pre>

<p>Take a look here: <a href="https://stackoverflow.com/questions/54032974/helm-conditionally-install-subchart">helm-charts-management</a>, <a href="https://github.com/helm/helm/issues/3742#issuecomment-383095917" rel="nofollow noreferrer">helm-chart-dependences</a>.</p>
