prometheus-node-exporter

by joaquinito2051

Helm chartv6.0.0App 1.13.1Apache-2.0

A Helm chart for prometheus node-exporter

About this chart

Prometheus Node Exporter

Prometheus exporter for hardware and OS metrics exposed by *NIX kernels, written in Go with pluggable metric collectors.

This chart bootstraps a Prometheus Node Exporter daemonset on a Kubernetes cluster using the Helm package manager.

Usage

The chart is distributed as an OCI Artifact as well as via a traditional Helm Repository.

  • OCI Artifact: oci://ghcr.io/prometheus-community/charts/prometheus-node-exporter
  • Helm Repository: https://prometheus-community.github.io/helm-charts with chart prometheus-node-exporter

The installation instructions use the OCI registry. Refer to the [helm repo](helm repo) command documentation for information on installing charts via the traditional repository.

Install Chart

helm install [RELEASE_NAME] oci://ghcr.io/prometheus-community/charts/prometheus-node-exporter

See configuration below.

See helm install for command documentation.

Uninstall Chart

helm uninstall [RELEASE_NAME]

This removes all the Kubernetes components associated with the chart and deletes the release.

See helm uninstall for command documentation.

Upgrading Chart

helm upgrade [RELEASE_NAME] oci://ghcr.io/prometheus-community/charts/prometheus-node-exporter --install

See helm upgrade for command documentation.

5.x to 6.x

The default filesystem collector arguments moved from extraArgs to the new defaultArgs value, and extraArgs is now empty, so arguments you add no longer replace the defaults.

If you copied the defaults into your own extraArgs, remove them there. node-exporter refuses a flag given twice and would not start. To change or drop a default, override defaultArgs instead.

4.x to 5.x

Version 5.0.0 adds restrictive security context defaults. Host access is unchanged (hostNetwork, hostPID and the /proc, /sys and / hostPath mounts keep their previous defaults).

  • containerSecurityContext sets allowPrivilegeEscalation: false, capabilities.drop: [ALL] and seccompProfile.type: RuntimeDefault. These defaults are also applied to sidecars.
  • kubeRBACProxy.containerSecurityContext sets the same three fields.
  • The opt-in permissionInitContainer (runs as root to fix host file permissions) is unchanged.

Helm merges your values into these defaults. If you set privileged: true or add CAP_SYS_ADMIN in containerSecurityContext (for example for the perf collector), also set allowPrivilegeEscalation: true, because the API server rejects allowPrivilegeEscalation: false together with either of them. To restore the previous behaviour, set the new keys to null.

3.x to 4.x

Starting from version 4.0.0, the node exporter chart is using the Kubernetes recommended labels. Therefore you have to delete the daemonset before you upgrade.

kubectl delete daemonset -l app=prometheus-node-exporter
helm upgrade -i prometheus-node-exporter prometheus-community/prometheus-node-exporter

If you use your own custom ServiceMonitor or PodMonitor, please ensure to upgrade their selector fields accordingly to the new labels.

From 2.x to 3.x

Change the following:

hostRootFsMount: true

to:

hostRootFsMount:
  enabled: true
  mountPropagation: HostToContainer

Configuring

See Customizing the Chart Before Installing. To see all configurable options with detailed comments, visit the chart's values.yaml, or run these configuration commands:

helm show values oci://ghcr.io/prometheus-community/charts/prometheus-node-exporter

kube-rbac-proxy

You can enable prometheus-node-exporter endpoint protection using kube-rbac-proxy. By setting kubeRBACProxy.enabled: true, this chart will deploy a RBAC proxy container protecting the node-exporter endpoint. To authorize access, authenticate your requests (via a ServiceAccount for example) with a ClusterRole attached such as:

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: prometheus-node-exporter-read
rules:
  - apiGroups: [ "" ]
    resources: ["services/node-exporter-prometheus-node-exporter"]
    verbs:
      - get

See kube-rbac-proxy examples for more details.

Deploy prometheus-node-exporter with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has prometheus-node-exporter on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartprometheus-node-exporter is pinned at v6.0.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply