Skip to content

Commit

Permalink
Disable controller and scheduler alerts in managed clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
dctrwatson committed Nov 6, 2019
1 parent 6a6a43e commit 235761f
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 235761f

Please sign in to comment.