Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-13 03:08:05 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-13 03:08:05 +0300
commit47b8f79a0896f406008d5a7eda2781f8da301e91 (patch)
tree1f15328719ca1215a2bd0ec6650ece0ca59de3f4 /lib/gitlab/kubernetes
parent52fe64b740a4ddbd5b085386dfe40fea191174ea (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/kubernetes')
-rw-r--r--lib/gitlab/kubernetes/helm/client_command.rb32
-rw-r--r--lib/gitlab/kubernetes/helm/delete_command.rb2
-rw-r--r--lib/gitlab/kubernetes/helm/install_command.rb2
3 files changed, 29 insertions, 7 deletions
diff --git a/lib/gitlab/kubernetes/helm/client_command.rb b/lib/gitlab/kubernetes/helm/client_command.rb
index a3f732e1283..df3f35d1075 100644
--- a/lib/gitlab/kubernetes/helm/client_command.rb
+++ b/lib/gitlab/kubernetes/helm/client_command.rb
@@ -5,14 +5,24 @@ module Gitlab
module Helm
module ClientCommand
def init_command
- # Here we are always upgrading to the latest version of Tiller when
- # installing an app. We ensure the helm version stored in the
- # database is correct by also updating this after transition to
- # :installed,:updated in Clusters::Concerns::ApplicationStatus
- 'helm init --upgrade'
+ if local_tiller_enabled?
+ <<~HEREDOC.chomp
+ export HELM_HOST="localhost:44134"
+ tiller -listen ${HELM_HOST} -alsologtostderr &
+ helm init --client-only
+ HEREDOC
+ else
+ # Here we are always upgrading to the latest version of Tiller when
+ # installing an app. We ensure the helm version stored in the
+ # database is correct by also updating this after transition to
+ # :installed,:updated in Clusters::Concerns::ApplicationStatus
+ 'helm init --upgrade'
+ end
end
def wait_for_tiller_command
+ return if local_tiller_enabled?
+
helm_check = ['helm', 'version', *optional_tls_flags].shelljoin
# This is necessary to give Tiller time to restart after upgrade.
# Ideally we'd be able to use --wait but cannot because of
@@ -25,6 +35,14 @@ module Gitlab
['helm', 'repo', 'add', name, repository].shelljoin if repository
end
+ private
+
+ def tls_flags_if_remote_tiller
+ return [] if local_tiller_enabled?
+
+ optional_tls_flags
+ end
+
def optional_tls_flags
return [] unless files.key?(:'ca.pem')
@@ -35,6 +53,10 @@ module Gitlab
'--tls-key', "#{files_dir}/key.pem"
]
end
+
+ def local_tiller_enabled?
+ Feature.enabled?(:managed_apps_local_tiller)
+ end
end
end
end
diff --git a/lib/gitlab/kubernetes/helm/delete_command.rb b/lib/gitlab/kubernetes/helm/delete_command.rb
index dcf22e7abb6..9d0fd30ba8f 100644
--- a/lib/gitlab/kubernetes/helm/delete_command.rb
+++ b/lib/gitlab/kubernetes/helm/delete_command.rb
@@ -39,7 +39,7 @@ module Gitlab
private
def delete_command
- command = ['helm', 'delete', '--purge', name] + optional_tls_flags
+ command = ['helm', 'delete', '--purge', name] + tls_flags_if_remote_tiller
command.shelljoin
end
diff --git a/lib/gitlab/kubernetes/helm/install_command.rb b/lib/gitlab/kubernetes/helm/install_command.rb
index ccb053f507d..82f6f5d0024 100644
--- a/lib/gitlab/kubernetes/helm/install_command.rb
+++ b/lib/gitlab/kubernetes/helm/install_command.rb
@@ -49,7 +49,7 @@ module Gitlab
command = ['helm', 'upgrade', name, chart] +
install_flag +
reset_values_flag +
- optional_tls_flags +
+ tls_flags_if_remote_tiller +
optional_version_flag +
rbac_create_flag +
namespace_flag +