Reference / experimental
prometheus-default-rules
These docs describe Kix's main branch, which can include changes not yet released. Read the docs for the latest release.
Default Kubernetes monitoring rules and service monitors
This page is generated from kix/packages/experimental/prometheus-default-rules.
| Stability | Experimental |
package value | packages.experimental.prometheus-default-rules |
Dependencies
Section titled “Dependencies”Kix matches each dependency below to another package instance by instance name, alias, or role. To bind a specific instance, set deps.<name> in your cluster definition. See Declaring dependencies for how required and optional dependencies work.
| Dependency | Requirement |
|---|---|
prometheusOperator | Required |
alertmanager | Optional |
dns | Optional |
kubeStateMetrics | Optional |
nodeExporter | Optional |
prometheusServer | Optional |
Options
Section titled “Options”monitors.apiserver.enabled
Section titled “monitors.apiserver.enabled”Scrape the API server through the kubernetes Service in default.
- Type:
boolean - Default:
true
monitors.apiserver.endpoint
Section titled “monitors.apiserver.endpoint”Fields deep-merged into each of this monitor’s ServiceMonitor endpoints, such as interval, scheme, tlsConfig, or metricRelabelings (a list replaces the package’s). port and path are refused. A file named here must be in the Prometheus pods, for example a Secret listed in the prometheus instance’s extraSpec.secrets, mounted at /etc/prometheus/secrets/<name>.
-
Type:
attribute set of anything -
Default:
{ } -
Example:
1{2scheme = "https";3tlsConfig = {4caFile = "/etc/prometheus/secrets/etcd-client/ca.crt";5certFile = "/etc/prometheus/secrets/etcd-client/tls.crt";6keyFile = "/etc/prometheus/secrets/etcd-client/tls.key";7};8}
monitors.coredns.enabled
Section titled “monitors.coredns.enabled”Scrape coredns. Skipped while the dns provider scrapes itself (out.scrapedByPrometheus).
- Type:
boolean - Default:
true
monitors.coredns.endpoint
Section titled “monitors.coredns.endpoint”Fields deep-merged into each of this monitor’s ServiceMonitor endpoints, such as interval, scheme, tlsConfig, or metricRelabelings (a list replaces the package’s). port and path are refused. A file named here must be in the Prometheus pods, for example a Secret listed in the prometheus instance’s extraSpec.secrets, mounted at /etc/prometheus/secrets/<name>.
-
Type:
attribute set of anything -
Default:
{ } -
Example:
1{2scheme = "https";3tlsConfig = {4caFile = "/etc/prometheus/secrets/etcd-client/ca.crt";5certFile = "/etc/prometheus/secrets/etcd-client/tls.crt";6keyFile = "/etc/prometheus/secrets/etcd-client/tls.key";7};8}
monitors.coredns.port
Section titled “monitors.coredns.port”Port coredns serves metrics on.
- Type:
16 bit unsigned integer; between 0 and 65535 (both inclusive) - Default:
9153
monitors.coredns.selector
Section titled “monitors.coredns.selector”Labels of the coredns pods in kube-system that the bridge Service selects. A value replaces the default as a whole; null uses the default.
-
Type:
null or (attribute set of string) -
Default:
1{2k8s-app = "kube-dns";3}
monitors.enabled
Section titled “monitors.enabled”Render the component ServiceMonitors. Each component also has its own enabled.
- Type:
boolean - Default:
true
monitors.etcd.enabled
Section titled “monitors.etcd.enabled”Scrape kube-etcd. Off also leaves out the rule groups that read only its series: etcd.
- Type:
boolean - Default:
true
monitors.etcd.endpoint
Section titled “monitors.etcd.endpoint”Fields deep-merged into each of this monitor’s ServiceMonitor endpoints, such as interval, scheme, tlsConfig, or metricRelabelings (a list replaces the package’s). port and path are refused. A file named here must be in the Prometheus pods, for example a Secret listed in the prometheus instance’s extraSpec.secrets, mounted at /etc/prometheus/secrets/<name>.
-
Type:
attribute set of anything -
Default:
{ } -
Example:
1{2scheme = "https";3tlsConfig = {4caFile = "/etc/prometheus/secrets/etcd-client/ca.crt";5certFile = "/etc/prometheus/secrets/etcd-client/tls.crt";6keyFile = "/etc/prometheus/secrets/etcd-client/tls.key";7};8}
monitors.etcd.endpoints
Section titled “monitors.etcd.endpoints”Fixed IP addresses of kube-etcd, for a control plane that does not run as pods in the cluster. The bridge Service then selects no pods and an Endpoints object lists these addresses.
-
Type:
list of non-empty string -
Default:
[ ] -
Example:
1[2"10.0.0.10"3]
monitors.etcd.port
Section titled “monitors.etcd.port”Port kube-etcd serves metrics on.
- Type:
16 bit unsigned integer; between 0 and 65535 (both inclusive) - Default:
2381
monitors.etcd.selector
Section titled “monitors.etcd.selector”Labels of the kube-etcd pods in kube-system that the bridge Service selects. A value replaces the default as a whole; null uses the default.
-
Type:
null or (attribute set of string) -
Default:
1{2component = "etcd";3}
monitors.kubeControllerManager.enabled
Section titled “monitors.kubeControllerManager.enabled”Scrape kube-controller-manager. Off also leaves out the rule groups that read only its series: kubernetes-system-controller-manager.
- Type:
boolean - Default:
true
monitors.kubeControllerManager.endpoint
Section titled “monitors.kubeControllerManager.endpoint”Fields deep-merged into each of this monitor’s ServiceMonitor endpoints, such as interval, scheme, tlsConfig, or metricRelabelings (a list replaces the package’s). port and path are refused. A file named here must be in the Prometheus pods, for example a Secret listed in the prometheus instance’s extraSpec.secrets, mounted at /etc/prometheus/secrets/<name>.
-
Type:
attribute set of anything -
Default:
{ } -
Example:
1{2scheme = "https";3tlsConfig = {4caFile = "/etc/prometheus/secrets/etcd-client/ca.crt";5certFile = "/etc/prometheus/secrets/etcd-client/tls.crt";6keyFile = "/etc/prometheus/secrets/etcd-client/tls.key";7};8}
monitors.kubeControllerManager.endpoints
Section titled “monitors.kubeControllerManager.endpoints”Fixed IP addresses of kube-controller-manager, for a control plane that does not run as pods in the cluster. The bridge Service then selects no pods and an Endpoints object lists these addresses.
-
Type:
list of non-empty string -
Default:
[ ] -
Example:
1[2"10.0.0.10"3]
monitors.kubeControllerManager.port
Section titled “monitors.kubeControllerManager.port”Port kube-controller-manager serves metrics on.
- Type:
16 bit unsigned integer; between 0 and 65535 (both inclusive) - Default:
10257
monitors.kubeControllerManager.selector
Section titled “monitors.kubeControllerManager.selector”Labels of the kube-controller-manager pods in kube-system that the bridge Service selects. A value replaces the default as a whole; null uses the default.
-
Type:
null or (attribute set of string) -
Default:
1{2component = "kube-controller-manager";3}
monitors.kubeProxy.enabled
Section titled “monitors.kubeProxy.enabled”Scrape kube-proxy. Off also leaves out the rule groups that read only its series: kubernetes-system-kube-proxy.
- Type:
boolean - Default:
true
monitors.kubeProxy.endpoint
Section titled “monitors.kubeProxy.endpoint”Fields deep-merged into each of this monitor’s ServiceMonitor endpoints, such as interval, scheme, tlsConfig, or metricRelabelings (a list replaces the package’s). port and path are refused. A file named here must be in the Prometheus pods, for example a Secret listed in the prometheus instance’s extraSpec.secrets, mounted at /etc/prometheus/secrets/<name>.
-
Type:
attribute set of anything -
Default:
{ } -
Example:
1{2scheme = "https";3tlsConfig = {4caFile = "/etc/prometheus/secrets/etcd-client/ca.crt";5certFile = "/etc/prometheus/secrets/etcd-client/tls.crt";6keyFile = "/etc/prometheus/secrets/etcd-client/tls.key";7};8}
monitors.kubeProxy.endpoints
Section titled “monitors.kubeProxy.endpoints”Fixed IP addresses of kube-proxy, for a control plane that does not run as pods in the cluster. The bridge Service then selects no pods and an Endpoints object lists these addresses.
-
Type:
list of non-empty string -
Default:
[ ] -
Example:
1[2"10.0.0.10"3]
monitors.kubeProxy.port
Section titled “monitors.kubeProxy.port”Port kube-proxy serves metrics on.
- Type:
16 bit unsigned integer; between 0 and 65535 (both inclusive) - Default:
10249
monitors.kubeProxy.selector
Section titled “monitors.kubeProxy.selector”Labels of the kube-proxy pods in kube-system that the bridge Service selects. A value replaces the default as a whole; null uses the default.
-
Type:
null or (attribute set of string) -
Default:
1{2k8s-app = "kube-proxy";3}
monitors.kubeScheduler.enabled
Section titled “monitors.kubeScheduler.enabled”Scrape kube-scheduler. Off also leaves out the rule groups that read only its series: kube-scheduler.rules, kubernetes-system-scheduler.
- Type:
boolean - Default:
true
monitors.kubeScheduler.endpoint
Section titled “monitors.kubeScheduler.endpoint”Fields deep-merged into each of this monitor’s ServiceMonitor endpoints, such as interval, scheme, tlsConfig, or metricRelabelings (a list replaces the package’s). port and path are refused. A file named here must be in the Prometheus pods, for example a Secret listed in the prometheus instance’s extraSpec.secrets, mounted at /etc/prometheus/secrets/<name>.
-
Type:
attribute set of anything -
Default:
{ } -
Example:
1{2scheme = "https";3tlsConfig = {4caFile = "/etc/prometheus/secrets/etcd-client/ca.crt";5certFile = "/etc/prometheus/secrets/etcd-client/tls.crt";6keyFile = "/etc/prometheus/secrets/etcd-client/tls.key";7};8}
monitors.kubeScheduler.endpoints
Section titled “monitors.kubeScheduler.endpoints”Fixed IP addresses of kube-scheduler, for a control plane that does not run as pods in the cluster. The bridge Service then selects no pods and an Endpoints object lists these addresses.
-
Type:
list of non-empty string -
Default:
[ ] -
Example:
1[2"10.0.0.10"3]
monitors.kubeScheduler.port
Section titled “monitors.kubeScheduler.port”Port kube-scheduler serves metrics on.
- Type:
16 bit unsigned integer; between 0 and 65535 (both inclusive) - Default:
10259
monitors.kubeScheduler.selector
Section titled “monitors.kubeScheduler.selector”Labels of the kube-scheduler pods in kube-system that the bridge Service selects. A value replaces the default as a whole; null uses the default.
-
Type:
null or (attribute set of string) -
Default:
1{2component = "kube-scheduler";3}
monitors.kubelet.cAdvisor.enabled
Section titled “monitors.kubelet.cAdvisor.enabled”Also scrape the kubelets’ /metrics/cadvisor, the container resource usage.
- Type:
boolean - Default:
true
monitors.kubelet.enabled
Section titled “monitors.kubelet.enabled”Scrape every kubelet through the Service the operator maintains.
- Type:
boolean - Default:
true
monitors.kubelet.endpoint
Section titled “monitors.kubelet.endpoint”Fields deep-merged into each of this monitor’s ServiceMonitor endpoints, such as interval, scheme, tlsConfig, or metricRelabelings (a list replaces the package’s). port and path are refused. A file named here must be in the Prometheus pods, for example a Secret listed in the prometheus instance’s extraSpec.secrets, mounted at /etc/prometheus/secrets/<name>.
-
Type:
attribute set of anything -
Default:
{ } -
Example:
1{2scheme = "https";3tlsConfig = {4caFile = "/etc/prometheus/secrets/etcd-client/ca.crt";5certFile = "/etc/prometheus/secrets/etcd-client/tls.crt";6keyFile = "/etc/prometheus/secrets/etcd-client/tls.key";7};8}
monitors.kubelet.probes.enabled
Section titled “monitors.kubelet.probes.enabled”Also scrape the kubelets’ /metrics/probes, the probe results.
- Type:
boolean - Default:
true
ruleOverrides
Section titled “ruleOverrides”Changes to single alerts of the bundled rules, by alert name. A name that no bundled group defines is refused.
-
Type:
attribute set of (submodule) -
Default:
{ } -
Example:
1{2CPUThrottlingHigh = {3for = "1h";4labels = {5severity = "info";6};7};8NodeDiskIOSaturation = {9for = "6h";10};11}
ruleOverrides.<name>.annotations
Section titled “ruleOverrides.<name>.annotations”Annotations merged over the alert’s.
- Type:
attribute set of string - Default:
{ }
ruleOverrides.<name>.expr
Section titled “ruleOverrides.<name>.expr”Replaces the alert’s PromQL expression.
- Type:
null or non-empty string - Default:
null
ruleOverrides.<name>.for
Section titled “ruleOverrides.<name>.for”Replaces how long the expression must hold before the alert fires.
- Type:
null or non-empty string - Default:
null
ruleOverrides.<name>.labels
Section titled “ruleOverrides.<name>.labels”Labels merged over the alert’s, such as severity.
- Type:
attribute set of string - Default:
{ }
rules.alertmanager
Section titled “rules.alertmanager”Render the alertmanager rule group.
- Type:
boolean - Default:
true
rules.enabled
Section titled “rules.enabled”Render the bundled PrometheusRules. Each other key turns one rule group on or off.
- Type:
boolean - Default:
true
rules.etcd
Section titled “rules.etcd”Render the etcd rule group.
- Type:
boolean - Default:
true
rules.general
Section titled “rules.general”Render the general rule group.
- Type:
boolean - Default:
true
rules.k8sContainerCpuLimits
Section titled “rules.k8sContainerCpuLimits”Render the k8sContainerCpuLimits rule group.
- Type:
boolean - Default:
false
rules.k8sContainerCpuRequests
Section titled “rules.k8sContainerCpuRequests”Render the k8sContainerCpuRequests rule group.
- Type:
boolean - Default:
false
rules.k8sContainerMemoryLimits
Section titled “rules.k8sContainerMemoryLimits”Render the k8sContainerMemoryLimits rule group.
- Type:
boolean - Default:
false
rules.k8sContainerMemoryRequests
Section titled “rules.k8sContainerMemoryRequests”Render the k8sContainerMemoryRequests rule group.
- Type:
boolean - Default:
false
rules.kubeApiserver
Section titled “rules.kubeApiserver”Render the kubeApiserver rule group.
- Type:
boolean - Default:
true
rules.kubeProxy
Section titled “rules.kubeProxy”Render the kubeProxy rule group.
- Type:
boolean - Default:
true
rules.kubeScheduler
Section titled “rules.kubeScheduler”Render the kubeScheduler rule group.
- Type:
boolean - Default:
true
rules.kubeStateMetrics
Section titled “rules.kubeStateMetrics”Render the kubeStateMetrics rule group.
- Type:
boolean - Default:
true
rules.kubernetesApps
Section titled “rules.kubernetesApps”Render the kubernetesApps rule group.
- Type:
boolean - Default:
true
rules.kubernetesResources
Section titled “rules.kubernetesResources”Render the kubernetesResources rule group.
- Type:
boolean - Default:
true
rules.kubernetesStorage
Section titled “rules.kubernetesStorage”Render the kubernetesStorage rule group.
- Type:
boolean - Default:
true
rules.kubernetesSystem
Section titled “rules.kubernetesSystem”Render the kubernetesSystem rule group.
- Type:
boolean - Default:
true
rules.nodeExporter
Section titled “rules.nodeExporter”Render the nodeExporter rule group.
- Type:
boolean - Default:
true
rules.prometheus
Section titled “rules.prometheus”Render the prometheus rule group.
- Type:
boolean - Default:
true
rules.prometheusOperator
Section titled “rules.prometheusOperator”Render the prometheusOperator rule group.
- Type:
boolean - Default:
true
runbookUrl
Section titled “runbookUrl”Prefix of every alert’s runbook_url annotation, ending in a slash.
- Type:
string matching the pattern https?://.*/ - Default:
"https://runbooks.prometheus-operator.dev/runbooks/"