I have two different projects checked in Gitlab, frontend and backend. For both the projects i have a Dockerfile each. I have set the env variables in gitlab ci/cd . I am running docker container in kubernetes, but i am not able to access the gitlab env variables either in my react or node.js (express) application.
I was thinking that those env variable would be available to me when i do process.env.variable_name, but i am not able to access them.
What’s the best way to access Gitlab env variables in kubernetes (deployment.yaml) env variables ?
UPDATE
I have found that we can specify env variables in kubernetes, deployment.yaml file (under env section). How can i pass gitlab env variables to deployment.yaml?
Docker containers require that you set environment variables when you run them:
https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file
--env , -e Set environment variables
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With