prometheus-nginx-exporter

by Prometheus

Helm chartv2.0.0App 1.5.3Verified publisher

A Helm chart for NGINX Prometheus Exporter

About this chart

NGINX Prometheus Exporter

This chart bootstraps a NGINX Prometheus Exporter deployment on a Kubernetes cluster using the Helm package manager.

Prerequisites

  • Kubernetes 1.19+ with Beta APIs enabled
  • Helm 3

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-nginx-exporter
  • Helm Repository: https://prometheus-community.github.io/helm-charts with chart prometheus-nginx-exporter

The installation instructions use the OCI registry. Refer to the 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-nginx-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-nginx-exporter --install

See helm upgrade for command documentation.

To 2.0.0

The exporter now runs with hardened defaults that follow the restricted Pod Security Standard:

  • podSecurityContext: runAsNonRoot: true, runAsUser: 1001, runAsGroup: 1001 (the user of the upstream image) and seccompProfile: RuntimeDefault.
  • securityContext: allowPrivilegeEscalation: false, all capabilities dropped and readOnlyRootFilesystem: true.
  • serviceAccount.automountServiceAccountToken defaults to false and applies to the Pod and, when serviceAccount.create is true, to the ServiceAccount. The exporter does not call the Kubernetes API.

The Role and RoleBinding (and the rbac.create value) are removed. They granted get on endpoints to the Pod's ServiceAccount, which is the namespace's default ServiceAccount unless serviceAccount.create or serviceAccount.name is set, so every Pod using that ServiceAccount gained the permission. The exporter does not use it. Helm deletes both objects on upgrade.

The Pod spec changes, so the exporter restarts once on upgrade. If you run a custom image that needs a different user or a writable root filesystem, override podSecurityContext / securityContext. Setting them to {} keeps the defaults because Helm merges maps; set them to null (for example --set podSecurityContext=null) to remove them, or set individual keys to null.

To 1.0

Chart release 1.0 reflects a major bump of the default NGINX Exporter image tag from major number 0 to 1.

This release has switched to using flags in the new format (--flag) but still supports the deprecated format (-flag) transparently for NGINX Exporter below release 1.0.0.

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-nginx-exporter

Deploy prometheus-nginx-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-nginx-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-nginx-exporter is pinned at v2.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