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
Léo-Paul Géneau
gitlab-ce
Commits
5841e923
Commit
5841e923
authored
Jun 20, 2018
by
Mayra Cabrera
Committed by
Kamil Trzciński (Conference till 20th)
Jun 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Unable to install Prometheus on Clusters: 'Error: Chart incompatible with Tiller v2.7.0'"
parent
3b38b4af
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
59 additions
and
34 deletions
+59
-34
app/models/clusters/applications/prometheus.rb
app/models/clusters/applications/prometheus.rb
+2
-1
changelogs/unreleased/48126-fix-prometheus-installation.yml
changelogs/unreleased/48126-fix-prometheus-installation.yml
+5
-0
lib/gitlab/kubernetes/helm/install_command.rb
lib/gitlab/kubernetes/helm/install_command.rb
+8
-3
spec/lib/gitlab/kubernetes/helm/api_spec.rb
spec/lib/gitlab/kubernetes/helm/api_spec.rb
+1
-7
spec/lib/gitlab/kubernetes/helm/install_command_spec.rb
spec/lib/gitlab/kubernetes/helm/install_command_spec.rb
+39
-23
spec/models/clusters/applications/ingress_spec.rb
spec/models/clusters/applications/ingress_spec.rb
+1
-0
spec/models/clusters/applications/jupyter_spec.rb
spec/models/clusters/applications/jupyter_spec.rb
+1
-0
spec/models/clusters/applications/prometheus_spec.rb
spec/models/clusters/applications/prometheus_spec.rb
+1
-0
spec/models/clusters/applications/runner_spec.rb
spec/models/clusters/applications/runner_spec.rb
+1
-0
No files found.
app/models/clusters/applications/prometheus.rb
View file @
5841e923
...
@@ -3,7 +3,7 @@ module Clusters
...
@@ -3,7 +3,7 @@ module Clusters
class
Prometheus
<
ActiveRecord
::
Base
class
Prometheus
<
ActiveRecord
::
Base
include
PrometheusAdapter
include
PrometheusAdapter
VERSION
=
"2.0.0"
.
freeze
VERSION
=
'6.7.3'
.
freeze
self
.
table_name
=
'clusters_applications_prometheus'
self
.
table_name
=
'clusters_applications_prometheus'
...
@@ -37,6 +37,7 @@ module Clusters
...
@@ -37,6 +37,7 @@ module Clusters
Gitlab
::
Kubernetes
::
Helm
::
InstallCommand
.
new
(
Gitlab
::
Kubernetes
::
Helm
::
InstallCommand
.
new
(
name
,
name
,
chart:
chart
,
chart:
chart
,
version:
version
,
values:
values
values:
values
)
)
end
end
...
...
changelogs/unreleased/48126-fix-prometheus-installation.yml
0 → 100644
View file @
5841e923
---
title
:
Specify chart version when installing applications on Clusters
merge_request
:
20010
author
:
type
:
fixed
lib/gitlab/kubernetes/helm/install_command.rb
View file @
5841e923
...
@@ -2,11 +2,12 @@ module Gitlab
...
@@ -2,11 +2,12 @@ module Gitlab
module
Kubernetes
module
Kubernetes
module
Helm
module
Helm
class
InstallCommand
<
BaseCommand
class
InstallCommand
<
BaseCommand
attr_reader
:name
,
:chart
,
:repository
,
:values
attr_reader
:name
,
:chart
,
:
version
,
:
repository
,
:values
def
initialize
(
name
,
chart
:,
values
:,
repository:
nil
)
def
initialize
(
name
,
chart
:,
values
:,
version:
nil
,
repository:
nil
)
@name
=
name
@name
=
name
@chart
=
chart
@chart
=
chart
@version
=
version
@values
=
values
@values
=
values
@repository
=
repository
@repository
=
repository
end
end
...
@@ -39,9 +40,13 @@ module Gitlab
...
@@ -39,9 +40,13 @@ module Gitlab
def
script_command
def
script_command
<<~
HEREDOC
<<~
HEREDOC
helm install
#{
chart
}
--name
#{
name
}
--namespace
#{
Gitlab
::
Kubernetes
::
Helm
::
NAMESPACE
}
-f /data/helm/
#{
name
}
/config/values.yaml >/dev/null
helm install
#{
chart
}
--name
#{
name
}
#{
optional_version_flag
}
--namespace
#{
Gitlab
::
Kubernetes
::
Helm
::
NAMESPACE
}
-f /data/helm/
#{
name
}
/config/values.yaml >/dev/null
HEREDOC
HEREDOC
end
end
def
optional_version_flag
" --version
#{
version
}
"
if
version
end
end
end
end
end
end
end
...
...
spec/lib/gitlab/kubernetes/helm/api_spec.rb
View file @
5841e923
...
@@ -7,13 +7,7 @@ describe Gitlab::Kubernetes::Helm::Api do
...
@@ -7,13 +7,7 @@ describe Gitlab::Kubernetes::Helm::Api do
let
(
:namespace
)
{
Gitlab
::
Kubernetes
::
Namespace
.
new
(
gitlab_namespace
,
client
)
}
let
(
:namespace
)
{
Gitlab
::
Kubernetes
::
Namespace
.
new
(
gitlab_namespace
,
client
)
}
let
(
:application
)
{
create
(
:clusters_applications_prometheus
)
}
let
(
:application
)
{
create
(
:clusters_applications_prometheus
)
}
let
(
:command
)
do
let
(
:command
)
{
application
.
install_command
}
Gitlab
::
Kubernetes
::
Helm
::
InstallCommand
.
new
(
application
.
name
,
chart:
application
.
chart
,
values:
application
.
values
)
end
subject
{
helm
}
subject
{
helm
}
...
...
spec/lib/gitlab/kubernetes/helm/install_command_spec.rb
View file @
5841e923
...
@@ -3,17 +3,13 @@ require 'rails_helper'
...
@@ -3,17 +3,13 @@ require 'rails_helper'
describe
Gitlab
::
Kubernetes
::
Helm
::
InstallCommand
do
describe
Gitlab
::
Kubernetes
::
Helm
::
InstallCommand
do
let
(
:application
)
{
create
(
:clusters_applications_prometheus
)
}
let
(
:application
)
{
create
(
:clusters_applications_prometheus
)
}
let
(
:namespace
)
{
Gitlab
::
Kubernetes
::
Helm
::
NAMESPACE
}
let
(
:namespace
)
{
Gitlab
::
Kubernetes
::
Helm
::
NAMESPACE
}
let
(
:install_command
)
{
application
.
install_command
}
let
(
:install_command
)
do
described_class
.
new
(
application
.
name
,
chart:
application
.
chart
,
values:
application
.
values
)
end
subject
{
install_command
}
subject
{
install_command
}
context
'for ingress'
do
let
(
:application
)
{
create
(
:clusters_applications_ingress
)
}
it_behaves_like
'helm commands'
do
it_behaves_like
'helm commands'
do
let
(
:commands
)
do
let
(
:commands
)
do
<<~
EOS
<<~
EOS
...
@@ -22,18 +18,38 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
...
@@ -22,18 +18,38 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
EOS
EOS
end
end
end
end
end
context
'for prometheus'
do
let
(
:application
)
{
create
(
:clusters_applications_prometheus
)
}
it_behaves_like
'helm commands'
do
let
(
:commands
)
do
<<~
EOS
helm init --client-only >/dev/null
helm install
#{
application
.
chart
}
--name
#{
application
.
name
}
--version
#{
application
.
version
}
--namespace
#{
namespace
}
-f /data/helm/
#{
application
.
name
}
/config/values.yaml >/dev/null
EOS
end
end
end
context
'
with an application with a repository
'
do
context
'
for runner
'
do
let
(
:ci_runner
)
{
create
(
:ci_runner
)
}
let
(
:ci_runner
)
{
create
(
:ci_runner
)
}
let
(
:application
)
{
create
(
:clusters_applications_runner
,
runner:
ci_runner
)
}
let
(
:application
)
{
create
(
:clusters_applications_runner
,
runner:
ci_runner
)
}
let
(
:install_command
)
do
described_class
.
new
(
it_behaves_like
'helm commands'
do
application
.
name
,
let
(
:commands
)
do
chart:
application
.
chart
,
<<~
EOS
values:
application
.
values
,
helm init --client-only >/dev/null
repository:
application
.
repository
helm repo add
#{
application
.
name
}
#{
application
.
repository
}
)
helm install
#{
application
.
chart
}
--name
#{
application
.
name
}
--namespace
#{
namespace
}
-f /data/helm/
#{
application
.
name
}
/config/values.yaml >/dev/null
EOS
end
end
end
end
context
'for jupyter'
do
let
(
:application
)
{
create
(
:clusters_applications_jupyter
)
}
it_behaves_like
'helm commands'
do
it_behaves_like
'helm commands'
do
let
(
:commands
)
do
let
(
:commands
)
do
...
...
spec/models/clusters/applications/ingress_spec.rb
View file @
5841e923
...
@@ -73,6 +73,7 @@ describe Clusters::Applications::Ingress do
...
@@ -73,6 +73,7 @@ describe Clusters::Applications::Ingress do
it
'should be initialized with ingress arguments'
do
it
'should be initialized with ingress arguments'
do
expect
(
subject
.
name
).
to
eq
(
'ingress'
)
expect
(
subject
.
name
).
to
eq
(
'ingress'
)
expect
(
subject
.
chart
).
to
eq
(
'stable/nginx-ingress'
)
expect
(
subject
.
chart
).
to
eq
(
'stable/nginx-ingress'
)
expect
(
subject
.
version
).
to
be_nil
expect
(
subject
.
values
).
to
eq
(
ingress
.
values
)
expect
(
subject
.
values
).
to
eq
(
ingress
.
values
)
end
end
end
end
...
...
spec/models/clusters/applications/jupyter_spec.rb
View file @
5841e923
...
@@ -36,6 +36,7 @@ describe Clusters::Applications::Jupyter do
...
@@ -36,6 +36,7 @@ describe Clusters::Applications::Jupyter do
it
'should be initialized with 4 arguments'
do
it
'should be initialized with 4 arguments'
do
expect
(
subject
.
name
).
to
eq
(
'jupyter'
)
expect
(
subject
.
name
).
to
eq
(
'jupyter'
)
expect
(
subject
.
chart
).
to
eq
(
'jupyter/jupyterhub'
)
expect
(
subject
.
chart
).
to
eq
(
'jupyter/jupyterhub'
)
expect
(
subject
.
version
).
to
be_nil
expect
(
subject
.
repository
).
to
eq
(
'https://jupyterhub.github.io/helm-chart/'
)
expect
(
subject
.
repository
).
to
eq
(
'https://jupyterhub.github.io/helm-chart/'
)
expect
(
subject
.
values
).
to
eq
(
jupyter
.
values
)
expect
(
subject
.
values
).
to
eq
(
jupyter
.
values
)
end
end
...
...
spec/models/clusters/applications/prometheus_spec.rb
View file @
5841e923
...
@@ -109,6 +109,7 @@ describe Clusters::Applications::Prometheus do
...
@@ -109,6 +109,7 @@ describe Clusters::Applications::Prometheus do
it
'should be initialized with 3 arguments'
do
it
'should be initialized with 3 arguments'
do
expect
(
subject
.
name
).
to
eq
(
'prometheus'
)
expect
(
subject
.
name
).
to
eq
(
'prometheus'
)
expect
(
subject
.
chart
).
to
eq
(
'stable/prometheus'
)
expect
(
subject
.
chart
).
to
eq
(
'stable/prometheus'
)
expect
(
subject
.
version
).
to
eq
(
'6.7.3'
)
expect
(
subject
.
values
).
to
eq
(
prometheus
.
values
)
expect
(
subject
.
values
).
to
eq
(
prometheus
.
values
)
end
end
end
end
...
...
spec/models/clusters/applications/runner_spec.rb
View file @
5841e923
...
@@ -31,6 +31,7 @@ describe Clusters::Applications::Runner do
...
@@ -31,6 +31,7 @@ describe Clusters::Applications::Runner do
it
'should be initialized with 4 arguments'
do
it
'should be initialized with 4 arguments'
do
expect
(
subject
.
name
).
to
eq
(
'runner'
)
expect
(
subject
.
name
).
to
eq
(
'runner'
)
expect
(
subject
.
chart
).
to
eq
(
'runner/gitlab-runner'
)
expect
(
subject
.
chart
).
to
eq
(
'runner/gitlab-runner'
)
expect
(
subject
.
version
).
to
be_nil
expect
(
subject
.
repository
).
to
eq
(
'https://charts.gitlab.io'
)
expect
(
subject
.
repository
).
to
eq
(
'https://charts.gitlab.io'
)
expect
(
subject
.
values
).
to
eq
(
gitlab_runner
.
values
)
expect
(
subject
.
values
).
to
eq
(
gitlab_runner
.
values
)
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