title: Setting values for nested elements in helm charts
body: <p>I'm working on the airflow Helm chart and I'm trying to spin up a local environment with helm, minikube and docker.</p>
  <p>When I helm install airflow through their <a href="https://github.com/helm/charts/blob/master/stable/airflow/examples/minikube/custom-values.yaml" rel="nofollow noreferrer">example/custom-values.yaml</a>, things look good.</p>
  <p>I would like now to add an extra container to that chart and have some environment variables defined for that container. The idea is to be able to override the values for those env variables through the <code>helm install .. --set</code> command.
  Here's the amended file:</p>
  <p><strong>custom-values.yaml</strong>:</p>
  <pre><code>#
  # NOTE:
  # - This is intended to be a `custom-values.yaml` starting point for non-production deployment (like minikube)
  
  # External Dependencies:
  # - A PUBLIC git repo for DAGs: ssh://git@repo.example.com:my-airflow-dags.git
  #
  
  ###################################
  # Airflow - Common Configs
  ###################################
  airflow:
    ## the airflow executor type to use
    ##
    executor: CeleryExecutor
  
    ## the fernet key used to encrypt the connections in the database
    ##
    fernetKey: &quot;&quot;
  
    ## environment variables for the web/scheduler/worker Pods (for airflow configs)
    ##
    config:
      # Security
      AIRFLOW__CORE__SECURE_MODE: &quot;True&quot;
      AIRFLOW__API__AUTH_BACKEND: &quot;airflow.api.auth.backend.deny_all&quot;
      AIRFLOW__WEBSERVER__EXPOSE_CONFIG: &quot;False&quot;
      AIRFLOW__WEBSERVER__RBAC: &quot;False&quot;
  
      # DAGS
      AIRFLOW__CORE__LOAD_EXAMPLES: &quot;False&quot;
  
      ## Disable noisy &quot;Handling signal: ttou&quot; Gunicorn log messages
      GUNICORN_CMD_ARGS: &quot;--log-level WARNING&quot;
  
  
    extraVolumes: 
      - name: synchronised-dags
        emptyDir: {}
  
    extraContainers:
      - name: s3-sync
        image: sidecar_python:latest
        imagePullPolicy: Never
        env:
          - name: BUCKET_NAME
            value: &quot;my-s3-bucket&quot;
          - name: PROJECT_NAME
            value: &quot;my-project&quot;
          - name: FEATURE_BRANCH
            value: &quot;my-branch&quot;
          - name: LOCAL_DIR
            value: &quot;/dags&quot;
        volumeMounts:
        - name: synchronised-dags
          mountPath: /dags
  
    extraVolumeMounts:
      - name: synchronised-dags
        mountPath: /opt/airflow/dags
  
  ###################################
  # Airflow - Scheduler Configs
  ###################################
  scheduler:
  
    ## custom airflow connections for the airflow scheduler
    ##
    connections:
      - id: my_aws
        type: aws
        extra: |
          {
            &quot;aws_access_key_id&quot;: &quot;XXXXXXXXXXXXXXXXXXX&quot;,
            &quot;aws_secret_access_key&quot;: &quot;XXXXXXXXXXXXXXX&quot;,
            &quot;region_name&quot;:&quot;eu-central-1&quot;
          }
  
    ## custom airflow variables for the airflow scheduler
    ##
    variables: |
      { &quot;environment&quot;: &quot;dev&quot; }
  
    ## custom airflow pools for the airflow scheduler
    ##
    pools: |
      {
        &quot;example&quot;: {
          &quot;description&quot;: &quot;This is an example pool with 2 slots.&quot;,
          &quot;slots&quot;: 2
        }
      }
  
  ###################################
  # Airflow - WebUI Configs
  ###################################
  web:
    ## configs for the Service of the web Pods
    ##
    service:
      type: NodePort
  
  ###################################
  # Airflow - Worker Configs
  ###################################
  workers:
    ## the number of workers Pods to run
    ##
    replicas: 1
  
  ###################################
  # Airflow - DAGs Configs
  ###################################
  dags:
  
    path: /opt/airflow/dags
  ###################################
  # Database - PostgreSQL Chart
  ###################################
  postgresql:
    enabled: true
  
  ###################################
  # Database - Redis Chart
  ###################################
  redis:
    enabled: false
  </code></pre>
  <p>I tried to override the values for the env variables defined in extraContainers.env as:</p>
  <pre><code>helm install airflow stable/airflow  --version &quot;7.1.0&quot; --namespace &quot;airflow&quot; -f ./custom-values.yaml --set extraContainers[0].env[0].name=BUCKET_NAME --set extraContainers[0].env[0].value=new-s3-bucket
  </code></pre>
  <p>I also tried to debug some of my tries using <code>--dry-run --debug</code> mode, but I can't seem to be able to override those values.</p>
  <p>Is there anything I should modify in the custom-values.yaml file to be able to pass new values through <code>--set</code>?</p>