<p>I am using <a href="https://gitlab.com/charts/gitlab" rel="noreferrer">https://gitlab.com/charts/gitlab</a> to deploy certain components included in the chart on an Openshift cluster. For now I just want to deploy the included Prometheus chart. I accomplished this, having an specific <code>values.yaml</code> configuration.</p>

<p>I want to extend the Gitlab helm chart, to do so I am adding it as a requirement of my own chart. The problem comes whenever I add the previous <code>values.yaml</code> as subpart of my values.</p>

<p>Deploying upstream Gitlab chart works with:</p>

<pre><code>global:
  registry:
    enabled: false
  # Disabling minio still requires to disable gitlab.minio or it will complain about "A valid backups.objectStorage.config.secret is needed"
  minio:
    enabled: false
  ingress:
    enabled: false
    configureCertmanager: false

nginx-ingress:
  enabled: false
registry:
  enabled: false
certmanager:
  install: false
  rbac:
    create: false
...
</code></pre>

<p>Deploying my chart including configuration as a subchart <strong>does not work</strong>:</p>

<pre><code>global:
  registry:
    enabled: false
  # Disabling minio still requires to disable gitlab.minio or it will complain about "A valid backups.objectStorage.config.secret is needed"
  minio:
    enabled: false
  ingress:
    enabled: false
    configureCertmanager: false


test:
  nginx-ingress:
    enabled: false

  registry:
    enabled: false
  certmanager:
    install: false
    rbac:
      create: false
  ...
</code></pre>

<p>I added the Gitlab upstream chart as a requirement:</p>

<pre><code>dependencies:
- name: gitlab
  # Upgrade manually. Check https://gitlab.com/charts/gitlab/blob/master/requirements.yaml for the new Prometheus chart version.
  version: 1.7.1
  repository: https://charts.gitlab.io/
  alias: test
</code></pre>

<p>It seems that it is not fully checking my configuration, so this creates objects that the serviceAccount does not have permissions to, failing in the process. It still tries to create objects related to <code>certmanager</code> even if it is disabled and was correctly disabled when deploying Gitlab chart directly.</p>

<p>Found it. Requirements conditions for a subchart have to be specified on the first level of <code>values.yaml</code>.</p>

<p>If A has B as a subchart requirement, in order to specify the B requirement conditions, you have to set them at A level:</p>

<pre><code>global:
  registry:
    enabled: false
  # Disabling minio still requires to disable gitlab.minio or it will complain about "A valid backups.objectStorage.config.secret is needed"
  minio:
    enabled: false
  ingress:
    enabled: false
    configureCertmanager: false


test:
  nginx-ingress:
    enabled: false

  registry:
    enabled: false
  ...

certmanager:
  install: false
  rbac:
    create: false
  ...
</code></pre>
