Skip to content
Snippets Groups Projects
Commit f0f07c3f authored by Jason Plum's avatar Jason Plum
Browse files

Merge branch 'configure-kubernetes-service' into 'master'

Automatically configure Kubernetes Service

Closes gitlab-ce#28888

See merge request !34
parents e525f0e0 1b2ef771
No related branches found
No related tags found
1 merge request!34Automatically configure Kubernetes Service
......@@ -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
......
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