Container Runner: Pass environment variables to tasks from HELM config

Hi there, I am trying to create an AWS CDK construct for setting up a kubernetes cluster that is running the helm chart for the container-agent that is running tasks.

We are wondering if it is somehow possible to pass in environment variables into the tasks that run our CircleCI jobs from the helm config?

const circleCiRunnerHelm = this.cluster.addHelmChart('CircleCiRunner', {
  chart: 'container-agent',
  repository: 'https://packagecloud.io/circleci/container-agent/helm',
  namespace,
  release: 'container-agent',
  values: {
    agent: {
      serviceContainers: {
        prefix: {
          "cimg/ruby": {
            env: [
              {
                name: 'FOO',
                value: 'bar',
              },
            ],
          },
        },
      },
      resourceClasses: {
        [`sofatutor/${dasherize(env.appName)}`]: {
          token: process.env.CIRCLECI_RUNNER_TOKEN,
        },
      },
    },
    serviceAccount: {
      create: false,
      name: circleCiServiceAccount.serviceAccountName,
    },
    nodeSelector: {
      'eks.amazonaws.com/compute-type': 'ec2',
    },
  },
});

While this can successfully be applied, the env vars unfortunately will not show up in the job. Unfortunately this is undocumented, but it would be very convenient if it would be possible, so we don’t have to manually set AWS specific env vars via the config.yml or the CirlceCI UI.

Thanks in advance for your help.

For anyone interested; I found it out, also like this I could keep working with the ramdisk feature:

const circleCiRunnerHelm = this.cluster.addHelmChart('CircleCiRunner', {
  chart: 'container-agent',
  repository: 'https://packagecloud.io/circleci/container-agent/helm',
  namespace,
  release: 'container-agent',
  values: {
    agent: {
      resourceClasses: {
        [`sofatutor/${dasherize(env.appName)}`]: {
          token: process.env.CIRCLECI_RUNNER_TOKEN,
          metadata: {
            labels: {
              app: dasherize(env.appName),
            },
          },
          serviceContainers: {
            prefix: {
              "cimg/mysql": {
                resources: {
                  requests: {
                    memory: '0.5',
                  },
                },
                volumeMounts: [
                  {
                    name: 'ramdisk',
                    mountPath: '/var/lib/mysql',
                  },
                ],
              },
            },
          },
          spec: {
            containers: [
              {
                env: [
                  {
                    name: 'FOO',
                    value: 'bar',
                  },
                ],
                volumeMounts: [
                  {
                    name: 'ramdisk',
                    mountPath: '/mnt/ramdisk',
                  },
                ],
                resources: {
                  requests: {
                    memory: '1500Mi',
                    cpu: '0.5',
                  },
                }
              },
            ],
            volumes: [
              {
                name: 'ramdisk',
                emptyDir: {
                  medium: 'Memory',
                },
              },
            ],
          },
        },
      },
    },
    serviceAccount: {
      create: false,
      name: circleCiServiceAccount.serviceAccountName,
    },
    nodeSelector: {
      'eks.amazonaws.com/compute-type': 'ec2',
    },
  },
});
circleCiRunnerHelm.node.addDependency(circleciNamespace);
}