Skip to content

Commit

Permalink
Merge pull request #298 from dctrwatson/disable-alerts-managed
Browse files Browse the repository at this point in the history
Disable controller and scheduler alerts in managed clusters
  • Loading branch information
brancz authored Nov 6, 2019
2 parents 6a6a43e + 235761f commit 223c163
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions jsonnet/kube-prometheus/kube-prometheus-managed-cluster.libsonnet
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// On managed Kubernetes clusters some of the control plane components are not exposed to customers.
// Disable scrape jobs and service monitors for these components by overwriting 'kube-prometheus.libsonnet' defaults
// Note this doesn't disable generation of associated alerting rules but the rules don't trigger
// Disable scrape jobs, service monitors, and alert groups for these components by overwriting 'kube-prometheus.libsonnet' defaults

{
_config+:: {
Expand All @@ -12,6 +11,18 @@
for k in std.objectFields(j)
if !std.setMember(k, ['KubeControllerManager', 'KubeScheduler'])
},

// Skip alerting rules too
prometheus+:: {
rules+:: {
local g = super.groups,
groups: [
h
for h in g
if !std.setMember(h.name, ['kubernetes-system-controller-manager', 'kubernetes-system-scheduler'])
],
},
},
},

// Same as above but for ServiceMonitor's
Expand All @@ -21,8 +32,4 @@
for q in std.objectFields(p)
if !std.setMember(q, ['serviceMonitorKubeControllerManager', 'serviceMonitorKubeScheduler'])
},

// TODO: disable generationg of alerting rules
// manifests/prometheus-rules.yaml:52: - name: kube-scheduler.rules

}

0 comments on commit 223c163

Please sign in to comment.