Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
661fd213
Commit
661fd213
authored
Oct 24, 2018
by
Chris Baumbauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update helm version 1.7.2 -> 2.11.0
parent
742f8d64
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
7 deletions
+38
-7
app/models/clusters/platforms/kubernetes.rb
app/models/clusters/platforms/kubernetes.rb
+6
-0
changelogs/unreleased/update-helm-version.yml
changelogs/unreleased/update-helm-version.yml
+4
-0
lib/gitlab/kubernetes/helm.rb
lib/gitlab/kubernetes/helm.rb
+1
-1
lib/gitlab/kubernetes/helm/base_command.rb
lib/gitlab/kubernetes/helm/base_command.rb
+1
-1
lib/gitlab/kubernetes/helm/install_command.rb
lib/gitlab/kubernetes/helm/install_command.rb
+20
-3
spec/lib/gitlab/kubernetes/helm/install_command_spec.rb
spec/lib/gitlab/kubernetes/helm/install_command_spec.rb
+4
-0
spec/support/shared_examples/helm_generated_script.rb
spec/support/shared_examples/helm_generated_script.rb
+2
-2
No files found.
app/models/clusters/platforms/kubernetes.rb
View file @
661fd213
...
@@ -25,6 +25,7 @@ module Clusters
...
@@ -25,6 +25,7 @@ module Clusters
algorithm:
'aes-256-cbc'
algorithm:
'aes-256-cbc'
before_validation
:enforce_namespace_to_lower_case
before_validation
:enforce_namespace_to_lower_case
before_validation
:enforce_ca_whitespace_trimming
validates
:namespace
,
validates
:namespace
,
allow_blank:
true
,
allow_blank:
true
,
...
@@ -191,6 +192,11 @@ module Clusters
...
@@ -191,6 +192,11 @@ module Clusters
self
.
namespace
=
self
.
namespace
&
.
downcase
self
.
namespace
=
self
.
namespace
&
.
downcase
end
end
def
enforce_ca_whitespace_trimming
self
.
ca_pem
=
self
.
ca_pem
&
.
strip
self
.
token
=
self
.
token
&
.
strip
end
def
prevent_modification
def
prevent_modification
return
unless
managed?
return
unless
managed?
...
...
changelogs/unreleased/update-helm-version.yml
0 → 100644
View file @
661fd213
---
title
:
Update Helm version to 2.11.0
author
:
Chris Baumbauer
type
:
changed
lib/gitlab/kubernetes/helm.rb
View file @
661fd213
module
Gitlab
module
Gitlab
module
Kubernetes
module
Kubernetes
module
Helm
module
Helm
HELM_VERSION
=
'2.
7.2
'
.
freeze
HELM_VERSION
=
'2.
11.0
'
.
freeze
NAMESPACE
=
'gitlab-managed-apps'
.
freeze
NAMESPACE
=
'gitlab-managed-apps'
.
freeze
SERVICE_ACCOUNT
=
'tiller'
.
freeze
SERVICE_ACCOUNT
=
'tiller'
.
freeze
CLUSTER_ROLE_BINDING
=
'tiller-admin'
.
freeze
CLUSTER_ROLE_BINDING
=
'tiller-admin'
.
freeze
...
...
lib/gitlab/kubernetes/helm/base_command.rb
View file @
661fd213
...
@@ -14,7 +14,7 @@ module Gitlab
...
@@ -14,7 +14,7 @@ module Gitlab
ALPINE_VERSION=$(cat /etc/alpine-release | cut -d '.' -f 1,2)
ALPINE_VERSION=$(cat /etc/alpine-release | cut -d '.' -f 1,2)
echo http://mirror.clarkson.edu/alpine/v$ALPINE_VERSION/main >> /etc/apk/repositories
echo http://mirror.clarkson.edu/alpine/v$ALPINE_VERSION/main >> /etc/apk/repositories
echo http://mirror1.hs-esslingen.de/pub/Mirrors/alpine/v$ALPINE_VERSION/main >> /etc/apk/repositories
echo http://mirror1.hs-esslingen.de/pub/Mirrors/alpine/v$ALPINE_VERSION/main >> /etc/apk/repositories
apk add -U wget ca-certificates openssl >/dev/null
apk add -U wget ca-certificates openssl
git
>/dev/null
wget -q -O - https://kubernetes-helm.storage.googleapis.com/helm-v
#{
Gitlab
::
Kubernetes
::
Helm
::
HELM_VERSION
}
-linux-amd64.tar.gz | tar zxC /tmp >/dev/null
wget -q -O - https://kubernetes-helm.storage.googleapis.com/helm-v
#{
Gitlab
::
Kubernetes
::
Helm
::
HELM_VERSION
}
-linux-amd64.tar.gz | tar zxC /tmp >/dev/null
mv /tmp/linux-amd64/helm /usr/bin/
mv /tmp/linux-amd64/helm /usr/bin/
HEREDOC
HEREDOC
...
...
lib/gitlab/kubernetes/helm/install_command.rb
View file @
661fd213
...
@@ -4,21 +4,23 @@ module Gitlab
...
@@ -4,21 +4,23 @@ module Gitlab
class
InstallCommand
class
InstallCommand
include
BaseCommand
include
BaseCommand
attr_reader
:name
,
:files
,
:chart
,
:version
,
:repository
attr_reader
:name
,
:files
,
:chart
,
:version
,
:repository
,
:setargs
def
initialize
(
name
:,
chart
:,
files
:,
rbac
:,
version:
nil
,
repository:
nil
)
def
initialize
(
name
:,
chart
:,
files
:,
rbac
:,
version:
nil
,
repository:
nil
,
setargs:
nil
)
@name
=
name
@name
=
name
@chart
=
chart
@chart
=
chart
@version
=
version
@version
=
version
@rbac
=
rbac
@rbac
=
rbac
@files
=
files
@files
=
files
@repository
=
repository
@repository
=
repository
@setargs
=
setargs
end
end
def
generate_script
def
generate_script
super
+
[
super
+
[
init_command
,
init_command
,
repository_command
,
repository_command
,
repository_update_command
,
script_command
script_command
].
compact
.
join
(
"
\n
"
)
].
compact
.
join
(
"
\n
"
)
end
end
...
@@ -37,6 +39,10 @@ module Gitlab
...
@@ -37,6 +39,10 @@ module Gitlab
[
'helm'
,
'repo'
,
'add'
,
name
,
repository
].
shelljoin
if
repository
[
'helm'
,
'repo'
,
'add'
,
name
,
repository
].
shelljoin
if
repository
end
end
def
repository_update_command
'helm repo update >/dev/null'
if
repository
end
def
script_command
def
script_command
command
=
[
'helm'
,
'install'
,
chart
]
+
install_command_flags
command
=
[
'helm'
,
'install'
,
chart
]
+
install_command_flags
...
@@ -47,13 +53,15 @@ module Gitlab
...
@@ -47,13 +53,15 @@ module Gitlab
name_flag
=
[
'--name'
,
name
]
name_flag
=
[
'--name'
,
name
]
namespace_flag
=
[
'--namespace'
,
Gitlab
::
Kubernetes
::
Helm
::
NAMESPACE
]
namespace_flag
=
[
'--namespace'
,
Gitlab
::
Kubernetes
::
Helm
::
NAMESPACE
]
value_flag
=
[
'-f'
,
"/data/helm/
#{
name
}
/config/values.yaml"
]
value_flag
=
[
'-f'
,
"/data/helm/
#{
name
}
/config/values.yaml"
]
args_flag
=
optional_install_set_args_flag
name_flag
+
name_flag
+
optional_tls_flags
+
optional_tls_flags
+
optional_version_flag
+
optional_version_flag
+
optional_rbac_create_flag
+
optional_rbac_create_flag
+
namespace_flag
+
namespace_flag
+
value_flag
value_flag
+
args_flag
end
end
def
optional_rbac_create_flag
def
optional_rbac_create_flag
...
@@ -64,6 +72,15 @@ module Gitlab
...
@@ -64,6 +72,15 @@ module Gitlab
%w[--set rbac.create=true,rbac.enabled=true]
%w[--set rbac.create=true,rbac.enabled=true]
end
end
def
optional_install_set_args_flag
return
[]
unless
setargs
args
=
[]
setargs
.
each
do
|
s
|
args
.
push
(
"--set"
,
s
)
end
end
def
optional_version_flag
def
optional_version_flag
return
[]
unless
version
return
[]
unless
version
...
...
spec/lib/gitlab/kubernetes/helm/install_command_spec.rb
View file @
661fd213
...
@@ -24,6 +24,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
...
@@ -24,6 +24,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
<<~
EOS
<<~
EOS
helm init --client-only >/dev/null
helm init --client-only >/dev/null
helm repo add app-name https://repository.example.com
helm repo add app-name https://repository.example.com
helm repo update >/dev/null
#{
helm_install_comand
}
#{
helm_install_comand
}
EOS
EOS
end
end
...
@@ -51,6 +52,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
...
@@ -51,6 +52,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
<<~
EOS
<<~
EOS
helm init --client-only >/dev/null
helm init --client-only >/dev/null
helm repo add app-name https://repository.example.com
helm repo add app-name https://repository.example.com
helm repo update >/dev/null
#{
helm_install_command
}
#{
helm_install_command
}
EOS
EOS
end
end
...
@@ -107,6 +109,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
...
@@ -107,6 +109,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
<<~
EOS
<<~
EOS
helm init --client-only >/dev/null
helm init --client-only >/dev/null
helm repo add app-name https://repository.example.com
helm repo add app-name https://repository.example.com
helm repo update >/dev/null
#{
helm_install_command
}
#{
helm_install_command
}
EOS
EOS
end
end
...
@@ -131,6 +134,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
...
@@ -131,6 +134,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
<<~
EOS
<<~
EOS
helm init --client-only >/dev/null
helm init --client-only >/dev/null
helm repo add app-name https://repository.example.com
helm repo add app-name https://repository.example.com
helm repo update >/dev/null
#{
helm_install_command
}
#{
helm_install_command
}
EOS
EOS
end
end
...
...
spec/support/shared_examples/helm_generated_script.rb
View file @
661fd213
...
@@ -6,8 +6,8 @@ shared_examples 'helm commands' do
...
@@ -6,8 +6,8 @@ shared_examples 'helm commands' do
ALPINE_VERSION=$(cat /etc/alpine-release | cut -d '.' -f 1,2)
ALPINE_VERSION=$(cat /etc/alpine-release | cut -d '.' -f 1,2)
echo http://mirror.clarkson.edu/alpine/v$ALPINE_VERSION/main >> /etc/apk/repositories
echo http://mirror.clarkson.edu/alpine/v$ALPINE_VERSION/main >> /etc/apk/repositories
echo http://mirror1.hs-esslingen.de/pub/Mirrors/alpine/v$ALPINE_VERSION/main >> /etc/apk/repositories
echo http://mirror1.hs-esslingen.de/pub/Mirrors/alpine/v$ALPINE_VERSION/main >> /etc/apk/repositories
apk add -U wget ca-certificates openssl >/dev/null
apk add -U wget ca-certificates openssl
git
>/dev/null
wget -q -O - https://kubernetes-helm.storage.googleapis.com/helm-v2.
7.2
-linux-amd64.tar.gz | tar zxC /tmp >/dev/null
wget -q -O - https://kubernetes-helm.storage.googleapis.com/helm-v2.
11.0
-linux-amd64.tar.gz | tar zxC /tmp >/dev/null
mv /tmp/linux-amd64/helm /usr/bin/
mv /tmp/linux-amd64/helm /usr/bin/
EOS
EOS
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment