Files
kube-prometheus/docs/windows.md
Dinesh Sharma dc0ad5e216 Addon: Use Hostprocess for Windows Exporter (#2048)
* Addon: Use Hostprocess for Windows Exporter #1627

This allows for Windows Exporter to be deployed and configured
dynamically without requiring to specify targets manually for each
Windows node

Documentation and example added

* Addon: Windows Exporter using Hostprocess

Fix some performance issues.
- Specify resource limits for windows exporter.
- Allow for scrape timeout and interval to be configured. Depending
on how many pods are running on a node it can take from 500ms to 15s
to scrape metrics from node. Default timeout is 10s.
- Allow for enabled collectors to be configured.
- Only enable collectors that are being used in rules and dashboards.

* Addon: Windows Exporter using Hostprocess

Fix formatting issues

* Fix formatting issues in windows-hostprocess addon

* Windows Addon: update doc to reflect both configs
- Hostprocess and static

* Windows Addon: update doc

---------

Co-authored-by: Dinesh Sharma <dinesh.sharma@health.telstra.com>
2023-06-12 09:58:45 +01:00

2.1 KiB

Windows

The Windows hostprocess addon adds the dashboards and rules from kubernetes-monitoring/kubernetes-mixin.

It also deploys windows_exporter as a hostprocess pod as Kubernetes now supports HostProcess containers on Windows nodes (as of v1.22). The cluster should be using containerd runtime.

local kp = (import 'kube-prometheus/main.libsonnet') +
  (import 'kube-prometheus/addons/windows-hostprocess.libsonnet') +
  {
    values+:: {
      windowsExporter+:: {
        image: "ghcr.io/prometheus-community/windows-exporter",
        version: "0.21.0",
      },
    },
  };

{ ['windows-exporter-' + name]: kp.windowsExporter[name] for name in std.objectFields(kp.windowsExporter) }

See the full example for setup.

If the cluster is running docker runtime then use the other Windows addon. The Windows addon does not deploy windows_exporter. Docker based Windows does not support running with windows_exporter in a pod so this add on uses additional scrape configuration to set up a static config to scrape the node ports where windows_exporter is configured.

The addon requires you to specify the node ips and ports where it can find the windows_exporter. See the full example for setup.

local kp = (import 'kube-prometheus/main.libsonnet') +
  (import 'kube-prometheus/addons/windows.libsonnet') +
  {
    values+:: {
      windowsScrapeConfig+:: {
          static_configs: {
              targets: ["10.240.0.65:5000", "10.240.0.63:5000"],
          },
      },
    },
  };