Kubernetes Config File Environment Variable

Hello everyone.

I want to pass from my CircleCI project environment variable to kubernetes config file. How can I do that?

I have a file config.yml:

apiVersion: v1
kind: ConfigMap

And the variables APP_NAME, APP_SUBGROUP and APP_GROUP are defined in the environment variables on CircleCI.

My .circleci/config.yml version is 2.1 and I’m using:

  gcp-cli: circleci/gcp-cli@1.8.3
  kubernetes: circleci/kubernetes@0.10.1

And in the middle of my .circleci/config.yml, I’m calling kubernetes orbs options:

      - kubernetes/install-kubectl
      - kubernetes/create-or-update-resource:
          resource-file-path: config/config.yml
          resource-name: deployment/config
          show-kubectl-command: true

So… What can I do to replace all my environment variables inside my k8s yamls configuration while my continuous deployment is running?

Thanks in advance.

1 Like

Anybody knows how to help me?


I have the same problem. We’re you able to find a solution?

I just gave up. There aren’t documentation for this kind of problem and they only help us if we pay for it. So… I resolved to change for Gitlab.com