# prometheus-default-rules

Default Kubernetes monitoring rules and service monitors

This page is generated from [`kix/packages/experimental/prometheus-default-rules`](https://github.com/kix-run/kix/tree/main/kix/packages/experimental/prometheus-default-rules).

| | |
| --- | --- |
| Stability | Experimental |
| `package` value | `packages.experimental.prometheus-default-rules` |

## Dependencies

Kix matches each dependency below to another package instance by instance name, alias, or role. To bind a specific instance, set [`deps.<name>`](/docs/reference/instances-and-composition/#deps) in your cluster definition. See [Declaring dependencies](/docs/reference/package-anatomy/#declaring-dependencies) for how required and optional dependencies work.

| Dependency | Requirement |
| --- | --- |
| `prometheusOperator` | Required |
| `alertmanager` | Optional |
| `dns` | Optional |
| `kubeStateMetrics` | Optional |
| `nodeExporter` | Optional |
| `prometheusServer` | Optional |

## Options

### `monitors.apiserver.enabled`

Scrape the API server through the `kubernetes` Service in `default`.

- **Type:** `boolean`
- **Default:** `true`

### `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:**

  ```nix
  {
    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";
    };
  }
  ```

### `monitors.coredns.enabled`

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

- **Type:** `boolean`
- **Default:** `true`

### `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:**

  ```nix
  {
    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";
    };
  }
  ```

### `monitors.coredns.port`

Port coredns serves metrics on.

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

### `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:**

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

### `monitors.enabled`

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

- **Type:** `boolean`
- **Default:** `true`

### `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`

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:**

  ```nix
  {
    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";
    };
  }
  ```

### `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:**

  ```nix
  [
    "10.0.0.10"
  ]
  ```

### `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`

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:**

  ```nix
  {
    component = "etcd";
  }
  ```

### `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`

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:**

  ```nix
  {
    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";
    };
  }
  ```

### `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:**

  ```nix
  [
    "10.0.0.10"
  ]
  ```

### `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`

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:**

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

### `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`

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:**

  ```nix
  {
    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";
    };
  }
  ```

### `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:**

  ```nix
  [
    "10.0.0.10"
  ]
  ```

### `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`

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:**

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

### `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`

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:**

  ```nix
  {
    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";
    };
  }
  ```

### `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:**

  ```nix
  [
    "10.0.0.10"
  ]
  ```

### `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`

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:**

  ```nix
  {
    component = "kube-scheduler";
  }
  ```

### `monitors.kubelet.cAdvisor.enabled`

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

- **Type:** `boolean`
- **Default:** `true`

### `monitors.kubelet.enabled`

Scrape every kubelet through the Service the operator maintains.

- **Type:** `boolean`
- **Default:** `true`

### `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:**

  ```nix
  {
    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";
    };
  }
  ```

### `monitors.kubelet.probes.enabled`

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

- **Type:** `boolean`
- **Default:** `true`

### `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:**

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

### `ruleOverrides.<name>.annotations`

Annotations merged over the alert's.

- **Type:** `attribute set of string`
- **Default:** `{ }`

### `ruleOverrides.<name>.expr`

Replaces the alert's PromQL expression.

- **Type:** `null or non-empty string`
- **Default:** `null`

### `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`

Labels merged over the alert's, such as `severity`.

- **Type:** `attribute set of string`
- **Default:** `{ }`

### `rules.alertmanager`

Render the alertmanager rule group.

- **Type:** `boolean`
- **Default:** `true`

### `rules.enabled`

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

- **Type:** `boolean`
- **Default:** `true`

### `rules.etcd`

Render the etcd rule group.

- **Type:** `boolean`
- **Default:** `true`

### `rules.general`

Render the general rule group.

- **Type:** `boolean`
- **Default:** `true`

### `rules.k8sContainerCpuLimits`

Render the k8sContainerCpuLimits rule group.

- **Type:** `boolean`
- **Default:** `false`

### `rules.k8sContainerCpuRequests`

Render the k8sContainerCpuRequests rule group.

- **Type:** `boolean`
- **Default:** `false`

### `rules.k8sContainerMemoryLimits`

Render the k8sContainerMemoryLimits rule group.

- **Type:** `boolean`
- **Default:** `false`

### `rules.k8sContainerMemoryRequests`

Render the k8sContainerMemoryRequests rule group.

- **Type:** `boolean`
- **Default:** `false`

### `rules.kubeApiserver`

Render the kubeApiserver rule group.

- **Type:** `boolean`
- **Default:** `true`

### `rules.kubeProxy`

Render the kubeProxy rule group.

- **Type:** `boolean`
- **Default:** `true`

### `rules.kubeScheduler`

Render the kubeScheduler rule group.

- **Type:** `boolean`
- **Default:** `true`

### `rules.kubeStateMetrics`

Render the kubeStateMetrics rule group.

- **Type:** `boolean`
- **Default:** `true`

### `rules.kubernetesApps`

Render the kubernetesApps rule group.

- **Type:** `boolean`
- **Default:** `true`

### `rules.kubernetesResources`

Render the kubernetesResources rule group.

- **Type:** `boolean`
- **Default:** `true`

### `rules.kubernetesStorage`

Render the kubernetesStorage rule group.

- **Type:** `boolean`
- **Default:** `true`

### `rules.kubernetesSystem`

Render the kubernetesSystem rule group.

- **Type:** `boolean`
- **Default:** `true`

### `rules.nodeExporter`

Render the nodeExporter rule group.

- **Type:** `boolean`
- **Default:** `true`

### `rules.prometheus`

Render the prometheus rule group.

- **Type:** `boolean`
- **Default:** `true`

### `rules.prometheusOperator`

Render the prometheusOperator rule group.

- **Type:** `boolean`
- **Default:** `true`

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