Reputation: 1425
I have GitLab running on a Kubernetes cluster.
I have a ConfigMap containing all my omnibus configurations. The ConfigMap gets mounted to the environment variable GITLAB_OMNIBUS_CONFIG.
This expose sensitive configurations like passwords in src code.
I'd like to create Secrets instead and mount them as additional Environment variables and have the omnibus config read from the additional Environment variables as in the example bellow.
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "mail.hostedemail.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "[email protected]"
gitlab_rails['smtp_password'] = $SMTP_PASSWORD
gitlab_rails['smtp_domain'] = "domain.com"
etc...
Upvotes: 5
Views: 1242
Reputation: 846
I have met the same issue with docker-compose and I resolved this by the Ruby ENV variable:
environment:
SMTP_USER_PASSWORD: ${SMTP_PASSWORD}
GITLAB_OMNIBUS_CONFIG: |
# Add any other gitlab.rb configuration here, each on its own line
gitlab_rails['smtp_password'] = ENV['SMTP_PASSWORD']
Upvotes: 4