summaryrefslogtreecommitdiff
path: root/app/models/clusters
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-12 06:09:05 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-12 06:09:05 +0000
commit8c9dc985b90c353b33cb829caf51f8320171bc15 (patch)
tree9a68886dbea1aefabddb46bbd3faf961eab22ae6 /app/models/clusters
parent500626a5c953ad81cfc3ed74bf0148c075617e58 (diff)
downloadgitlab-ce-8c9dc985b90c353b33cb829caf51f8320171bc15.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/clusters')
-rw-r--r--app/models/clusters/applications/elastic_stack.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/app/models/clusters/applications/elastic_stack.rb b/app/models/clusters/applications/elastic_stack.rb
index de7d3ab3fdb..ce42bc65579 100644
--- a/app/models/clusters/applications/elastic_stack.rb
+++ b/app/models/clusters/applications/elastic_stack.rb
@@ -30,7 +30,8 @@ module Clusters
version: VERSION,
rbac: cluster.platform_kubernetes_rbac?,
chart: chart,
- files: files
+ files: files,
+ postinstall: post_install_script
)
end
@@ -43,6 +44,10 @@ module Clusters
)
end
+ def files
+ super.merge('wait-for-elasticsearch.sh': File.read("#{Rails.root}/vendor/elastic_stack/wait-for-elasticsearch.sh"))
+ end
+
def elasticsearch_client
strong_memoize(:elasticsearch_client) do
next unless kube_client
@@ -69,10 +74,16 @@ module Clusters
private
+ def post_install_script
+ [
+ "timeout -t60 sh /data/helm/elastic-stack/config/wait-for-elasticsearch.sh http://elastic-stack-elasticsearch-client:9200"
+ ]
+ end
+
def post_delete_script
[
Gitlab::Kubernetes::KubectlCmd.delete("pvc", "--selector", "release=elastic-stack")
- ].compact
+ ]
end
def kube_client