Gitlab + GKE + AutoDevops set environment variables

末鹿安然 提交于 2020-03-05 05:03:20

问题


I have successfully deployed an app using gitlab auto devops on GKE.
How can I set environment variables for my app containers?

Variables like PORT, DB_URL, 3rd party services etc ...


回答1:


I am deploying to GKE from GitLab but without AutoDevops, but in k8s the env vars are defined in the deployment yaml. If you want to set them from GitLab and you want them to be different between deployments (production / dev etc.) then I recommend using Helm and passing --set to the helm install/upgrade command. The other alternative is to edit the yaml by your self in scripting, but this not needed if you are using Helm



来源:https://stackoverflow.com/questions/52588096/gitlab-gke-autodevops-set-environment-variables

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!