Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsonnet: Support scraping the config-reloader for AlertManager and Pr… #1344

Merged
merged 1 commit into from
Sep 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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