Skip to content

Commit

Permalink
Merge pull request #1344 from PhilipGough/MON-1085
Browse files Browse the repository at this point in the history
jsonnet: Support scraping the config-reloader for AlertManager and Pr…
  • Loading branch information
dgrisonnet authored Sep 22, 2021
2 parents 44466ff + 7b32afb commit 7f1092c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 4 deletions.
3 changes: 3 additions & 0 deletions jsonnet/kube-prometheus/components/alertmanager.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ local defaults = {
if !std.setMember(labelName, ['app.kubernetes.io/version'])
},
name: error 'must provide name',
reloaderPort: 8080,
config: {
global: {
resolve_timeout: '5m',
Expand Down Expand Up @@ -136,6 +137,7 @@ function(params) {
spec: {
ports: [
{ name: 'web', targetPort: 'web', port: 9093 },
{ name: 'reloader-web', port: am._config.reloaderPort, targetPort: 'reloader-web' },
],
selector: {
app: 'alertmanager',
Expand All @@ -161,6 +163,7 @@ function(params) {
},
endpoints: [
{ port: 'web', interval: '30s' },
{ port: 'reloader-web', interval: '30s' },
],
},
},
Expand Down
10 changes: 6 additions & 4 deletions jsonnet/kube-prometheus/components/prometheus.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ local defaults = {
},
},
thanos: null,
reloaderPort: 8080,
};


Expand Down Expand Up @@ -98,6 +99,7 @@ function(params) {
spec: {
ports: [
{ name: 'web', targetPort: 'web', port: 9090 },
{ name: 'reloader-web', port: p._config.reloaderPort, targetPort: 'reloader-web' },
] +
(
if p._config.thanos != null then
Expand Down Expand Up @@ -317,10 +319,10 @@ function(params) {
selector: {
matchLabels: p._config.selectorLabels,
},
endpoints: [{
port: 'web',
interval: '30s',
}],
endpoints: [
{ port: 'web', interval: '30s' },
{ port: 'reloader-web', interval: '30s' },
],
},
},

Expand Down
3 changes: 3 additions & 0 deletions manifests/alertmanager-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ spec:
- name: web
port: 9093
targetPort: web
- name: reloader-web
port: 8080
targetPort: reloader-web
selector:
alertmanager: main
app: alertmanager
Expand Down
2 changes: 2 additions & 0 deletions manifests/alertmanager-serviceMonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ spec:
endpoints:
- interval: 30s
port: web
- interval: 30s
port: reloader-web
selector:
matchLabels:
alertmanager: main
Expand Down
3 changes: 3 additions & 0 deletions manifests/prometheus-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ spec:
- name: web
port: 9090
targetPort: web
- name: reloader-web
port: 8080
targetPort: reloader-web
selector:
app: prometheus
app.kubernetes.io/component: prometheus
Expand Down
2 changes: 2 additions & 0 deletions manifests/prometheus-serviceMonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ spec:
endpoints:
- interval: 30s
port: web
- interval: 30s
port: reloader-web
selector:
matchLabels:
app.kubernetes.io/component: prometheus
Expand Down

0 comments on commit 7f1092c

Please sign in to comment.