Skip to content
Install the CLI

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.

StabilityExperimental
package valuepackages.experimental.prometheus-default-rules

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.

DependencyRequirement
prometheusOperatorRequired
alertmanagerOptional
dnsOptional
kubeStateMetricsOptional
nodeExporterOptional
prometheusServerOptional

Scrape the API server through the kubernetes Service in default.

  • Type: boolean
  • Default: true

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:

    {
    scheme = "https";
    tlsConfig = {
    caFile = "/etc/prometheus/secrets/etcd-client/ca.crt";
    certFile = "/etc/prometheus/secrets/etcd-client/tls.crt";
    keyFile = "/etc/prometheus/secrets/etcd-client/tls.key";
    };
    }

Scrape coredns. Skipped while the dns provider scrapes itself (out.scrapedByPrometheus).

  • Type: boolean
  • Default: true

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:

    {
    scheme = "https";
    tlsConfig = {
    caFile = "/etc/prometheus/secrets/etcd-client/ca.crt";
    certFile = "/etc/prometheus/secrets/etcd-client/tls.crt";
    keyFile = "/etc/prometheus/secrets/etcd-client/tls.key";
    };
    }

Port coredns serves metrics on.

  • Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)
  • Default: 9153

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:

    {
    k8s-app = "kube-dns";
    }

Render the component ServiceMonitors. Each component also has its own enabled.

  • Type: boolean
  • Default: true

Scrape kube-etcd. Off also leaves out the rule groups that read only its series: etcd.

  • Type: boolean
  • Default: true

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:

    {
    scheme = "https";
    tlsConfig = {
    caFile = "/etc/prometheus/secrets/etcd-client/ca.crt";
    certFile = "/etc/prometheus/secrets/etcd-client/tls.crt";
    keyFile = "/etc/prometheus/secrets/etcd-client/tls.key";
    };
    }

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:

    [
    "10.0.0.10"
    ]

Port kube-etcd serves metrics on.

  • Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)
  • Default: 2381

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:

    {
    component = "etcd";
    }

Scrape kube-controller-manager. Off also leaves out the rule groups that read only its series: kubernetes-system-controller-manager.

  • Type: boolean
  • Default: true

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:

    {
    scheme = "https";
    tlsConfig = {
    caFile = "/etc/prometheus/secrets/etcd-client/ca.crt";
    certFile = "/etc/prometheus/secrets/etcd-client/tls.crt";
    keyFile = "/etc/prometheus/secrets/etcd-client/tls.key";
    };
    }

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:

    [
    "10.0.0.10"
    ]

Port kube-controller-manager serves metrics on.

  • Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)
  • Default: 10257

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:

    {
    component = "kube-controller-manager";
    }

Scrape kube-proxy. Off also leaves out the rule groups that read only its series: kubernetes-system-kube-proxy.

  • Type: boolean
  • Default: true

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:

    {
    scheme = "https";
    tlsConfig = {
    caFile = "/etc/prometheus/secrets/etcd-client/ca.crt";
    certFile = "/etc/prometheus/secrets/etcd-client/tls.crt";
    keyFile = "/etc/prometheus/secrets/etcd-client/tls.key";
    };
    }

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:

    [
    "10.0.0.10"
    ]

Port kube-proxy serves metrics on.

  • Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)
  • Default: 10249

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:

    {
    k8s-app = "kube-proxy";
    }

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

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:

    {
    scheme = "https";
    tlsConfig = {
    caFile = "/etc/prometheus/secrets/etcd-client/ca.crt";
    certFile = "/etc/prometheus/secrets/etcd-client/tls.crt";
    keyFile = "/etc/prometheus/secrets/etcd-client/tls.key";
    };
    }

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:

    [
    "10.0.0.10"
    ]

Port kube-scheduler serves metrics on.

  • Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)
  • Default: 10259

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:

    {
    component = "kube-scheduler";
    }

Also scrape the kubelets’ /metrics/cadvisor, the container resource usage.

  • Type: boolean
  • Default: true

Scrape every kubelet through the Service the operator maintains.

  • Type: boolean
  • Default: true

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:

    {
    scheme = "https";
    tlsConfig = {
    caFile = "/etc/prometheus/secrets/etcd-client/ca.crt";
    certFile = "/etc/prometheus/secrets/etcd-client/tls.crt";
    keyFile = "/etc/prometheus/secrets/etcd-client/tls.key";
    };
    }

Also scrape the kubelets’ /metrics/probes, the probe results.

  • Type: boolean
  • Default: true

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:

    {
    CPUThrottlingHigh = {
    for = "1h";
    labels = {
    severity = "info";
    };
    };
    NodeDiskIOSaturation = {
    for = "6h";
    };
    }

Annotations merged over the alert’s.

  • Type: attribute set of string
  • Default: { }

Replaces the alert’s PromQL expression.

  • Type: null or non-empty string
  • Default: null

Replaces how long the expression must hold before the alert fires.

  • Type: null or non-empty string
  • Default: null

Labels merged over the alert’s, such as severity.

  • Type: attribute set of string
  • Default: { }

Render the alertmanager rule group.

  • Type: boolean
  • Default: true

Render the bundled PrometheusRules. Each other key turns one rule group on or off.

  • Type: boolean
  • Default: true

Render the etcd rule group.

  • Type: boolean
  • Default: true

Render the general rule group.

  • Type: boolean
  • Default: true

Render the k8sContainerCpuLimits rule group.

  • Type: boolean
  • Default: false

Render the k8sContainerCpuRequests rule group.

  • Type: boolean
  • Default: false

Render the k8sContainerMemoryLimits rule group.

  • Type: boolean
  • Default: false

Render the k8sContainerMemoryRequests rule group.

  • Type: boolean
  • Default: false

Render the kubeApiserver rule group.

  • Type: boolean
  • Default: true

Render the kubeProxy rule group.

  • Type: boolean
  • Default: true

Render the kubeScheduler rule group.

  • Type: boolean
  • Default: true

Render the kubeStateMetrics rule group.

  • Type: boolean
  • Default: true

Render the kubernetesApps rule group.

  • Type: boolean
  • Default: true

Render the kubernetesResources rule group.

  • Type: boolean
  • Default: true

Render the kubernetesStorage rule group.

  • Type: boolean
  • Default: true

Render the kubernetesSystem rule group.

  • Type: boolean
  • Default: true

Render the nodeExporter rule group.

  • Type: boolean
  • Default: true

Render the prometheus rule group.

  • Type: boolean
  • Default: true

Render the prometheusOperator rule group.

  • Type: boolean
  • Default: true

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/"