Skip to content
Snippets Groups Projects
Unverified Commit 1b2ef771 authored by Kamil Trzcinski's avatar Kamil Trzcinski
Browse files

Automatically configure Kubernetes Service

parent e525f0e0
No related branches found
No related tags found
1 merge request!34Automatically configure Kubernetes Service
Loading
Loading
@@ -137,9 +137,25 @@ spec:
'redis.addr' => "gitlab-redis:6379",
}
 
- name: GITLAB_POST_RECONFIGURE_CODE
value: |
Doorkeeper::Application.where(uid: ENV["MATTERMOST_APP_UID"]).first_or_create(
name: "GitLab Mattermost",
secret: ENV["MATTERMOST_APP_SECRET"],
redirect_uri: "#{ENV["GITLAB_MATTERMOST_EXTERNAL_SCHEME"]}://#{ENV["GITLAB_MATTERMOST_EXTERNAL_HOSTNAME"]}/signup/gitlab/complete\r\n#{ENV["GITLAB_MATTERMOST_EXTERNAL_SCHEME"]}://#{ENV["GITLAB_MATTERMOST_EXTERNAL_HOSTNAME"]}/login/gitlab/complete")
PrometheusService.where(template: true).first_or_create(
active: true, api_url: "http://localhost:9090")
KubernetesService.where(template: true).first_or_create(
active: true,
api_url: "https://#{ENV["KUBERNETES_SERVICE_HOST"]}:#{ENV["KUBERNETES_SERVICE_PORT"]}",
token: File.read("/var/run/secrets/kubernetes.io/serviceaccount/token"),
ca_pem: File.read("/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"))
- name: GITLAB_POST_RECONFIGURE_SCRIPT
value: |
/opt/gitlab/bin/gitlab-rails runner -e production 'Doorkeeper::Application.where(uid: ENV["MATTERMOST_APP_UID"], secret: ENV["MATTERMOST_APP_SECRET"], redirect_uri: "#{ENV["GITLAB_MATTERMOST_EXTERNAL_SCHEME"]}://#{ENV["GITLAB_MATTERMOST_EXTERNAL_HOSTNAME"]}/signup/gitlab/complete\r\n#{ENV["GITLAB_MATTERMOST_EXTERNAL_SCHEME"]}://#{ENV["GITLAB_MATTERMOST_EXTERNAL_HOSTNAME"]}/login/gitlab/complete", name: "GitLab Mattermost").first_or_create && PrometheusService.where(template: true).first_or_create(active: true, properties: {"api_url"=>"http://localhost:9090"})'
/opt/gitlab/bin/gitlab-rails runner -e production "$GITLAB_POST_RECONFIGURE_CODE"
ports:
- name: registry
containerPort: 8105
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment