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
1f912880
Commit
1f912880
authored
Feb 05, 2018
by
Joshua Lambert
Committed by
Kamil Trzciński
Feb 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable Prometheus metrics for deployed Ingresses
parent
1e66ff6d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
5 deletions
+26
-5
app/models/clusters/applications/ingress.rb
app/models/clusters/applications/ingress.rb
+5
-1
changelogs/unreleased/39985-enable-prometheus-metrics-for-deployed-ingresses.yml
...9985-enable-prometheus-metrics-for-deployed-ingresses.yml
+5
-0
lib/gitlab/kubernetes/helm/pod.rb
lib/gitlab/kubernetes/helm/pod.rb
+6
-2
spec/lib/gitlab/kubernetes/helm/pod_spec.rb
spec/lib/gitlab/kubernetes/helm/pod_spec.rb
+2
-2
vendor/ingress/values.yaml
vendor/ingress/values.yaml
+8
-0
No files found.
app/models/clusters/applications/ingress.rb
View file @
1f912880
...
@@ -17,8 +17,12 @@ module Clusters
...
@@ -17,8 +17,12 @@ module Clusters
'stable/nginx-ingress'
'stable/nginx-ingress'
end
end
def
chart_values_file
"
#{
Rails
.
root
}
/vendor/
#{
name
}
/values.yaml"
end
def
install_command
def
install_command
Gitlab
::
Kubernetes
::
Helm
::
InstallCommand
.
new
(
name
,
chart:
chart
)
Gitlab
::
Kubernetes
::
Helm
::
InstallCommand
.
new
(
name
,
chart:
chart
,
chart_values_file:
chart_values_file
)
end
end
end
end
end
end
...
...
changelogs/unreleased/39985-enable-prometheus-metrics-for-deployed-ingresses.yml
0 → 100644
View file @
1f912880
---
title
:
Enable Prometheus metrics for deployed Ingresses
merge_request
:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16866
author
:
joshlambert
type
:
changed
lib/gitlab/kubernetes/helm/pod.rb
View file @
1f912880
...
@@ -64,7 +64,7 @@ module Gitlab
...
@@ -64,7 +64,7 @@ module Gitlab
{
{
name:
'configuration-volume'
,
name:
'configuration-volume'
,
configMap:
{
configMap:
{
name:
'values-content-configuration'
,
name:
"values-content-configuration-
#{
command
.
name
}
"
,
items:
[{
key:
'values'
,
path:
'values.yaml'
}]
items:
[{
key:
'values'
,
path:
'values.yaml'
}]
}
}
}
}
...
@@ -81,7 +81,11 @@ module Gitlab
...
@@ -81,7 +81,11 @@ module Gitlab
def
create_config_map
def
create_config_map
resource
=
::
Kubeclient
::
Resource
.
new
resource
=
::
Kubeclient
::
Resource
.
new
resource
.
metadata
=
{
name:
'values-content-configuration'
,
namespace:
namespace_name
,
labels:
{
name:
'values-content-configuration'
}
}
resource
.
metadata
=
{
name:
"values-content-configuration-
#{
command
.
name
}
"
,
namespace:
namespace_name
,
labels:
{
name:
"values-content-configuration-
#{
command
.
name
}
"
}
}
resource
.
data
=
{
values:
File
.
read
(
command
.
chart_values_file
)
}
resource
.
data
=
{
values:
File
.
read
(
command
.
chart_values_file
)
}
kubeclient
.
create_config_map
(
resource
)
kubeclient
.
create_config_map
(
resource
)
end
end
...
...
spec/lib/gitlab/kubernetes/helm/pod_spec.rb
View file @
1f912880
...
@@ -63,14 +63,14 @@ describe Gitlab::Kubernetes::Helm::Pod do
...
@@ -63,14 +63,14 @@ describe Gitlab::Kubernetes::Helm::Pod do
it
'should mount configMap specification in the volume'
do
it
'should mount configMap specification in the volume'
do
spec
=
subject
.
generate
.
spec
spec
=
subject
.
generate
.
spec
expect
(
spec
.
volumes
.
first
.
configMap
[
'name'
]).
to
eq
(
'values-content-configuration'
)
expect
(
spec
.
volumes
.
first
.
configMap
[
'name'
]).
to
eq
(
"values-content-configuration-
#{
app
.
name
}
"
)
expect
(
spec
.
volumes
.
first
.
configMap
[
'items'
].
first
[
'key'
]).
to
eq
(
'values'
)
expect
(
spec
.
volumes
.
first
.
configMap
[
'items'
].
first
[
'key'
]).
to
eq
(
'values'
)
expect
(
spec
.
volumes
.
first
.
configMap
[
'items'
].
first
[
'path'
]).
to
eq
(
'values.yaml'
)
expect
(
spec
.
volumes
.
first
.
configMap
[
'items'
].
first
[
'path'
]).
to
eq
(
'values.yaml'
)
end
end
end
end
context
'without a configuration file'
do
context
'without a configuration file'
do
let
(
:app
)
{
create
(
:clusters_applications_
ingress
,
cluster:
cluster
)
}
let
(
:app
)
{
create
(
:clusters_applications_
helm
,
cluster:
cluster
)
}
it_behaves_like
'helm pod'
it_behaves_like
'helm pod'
...
...
vendor/ingress/values.yaml
0 → 100644
View file @
1f912880
controller
:
image
:
tag
:
"
0.10.2"
repository
:
"
quay.io/kubernetes-ingress-controller/nginx-ingress-controller"
stats.enabled
:
true
podAnnotations
:
prometheus.io/scrape
:
"
true"
prometheus.io/port
:
"
10254"
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