pvc-exporter

by Mario-F

Helm chartv1.4.1App v1.1.1Verified publisher

Helm chart to pvc-exporter https://github.com/Mario-F/pvc-exporter

About this chart

PVC Exporter Helm Chart

The helm chart to deploy pvc-exporter https://github.com/Mario-F/pvc-exporter

Usage

Using the helm chart simply by using the following commands:

helm repo add mariof-charts https://mario-f.github.io/helm-charts/
helm install pvc-exporter mariof-charts/pvc-exporter
# enable prometheus monitor and rules
helm upgrade --install --set serviceMonitor.enabled=true --set prometheusRule.enabled=true pvc-exporter mariof-charts/pvc-exporter

Values

KeyTypeDefaultDescription
image.repositorystring"ghcr.io/mario-f/pvc-exporter"
image.repositorystring".AppVersion"
image.pullPolicystring"IfNotPresent"
image.pullSecretslist[]
serviceAccount.createboolfalse
scrapeIntervalint15
pvcMapper.replicaCountint1
pvcMapper.metricsPortint8849
pvcMapper.extraArgslist[]
pvcMapper.resources.requests.cpustring"100m"
pvcMapper.resources.requests.memorystring"50Mi"
pvcMapper.resources.limits.cpustring"1000m"
pvcMapper.resources.limits.memorystring"200Mi"
pvcScanner.metricsPortint8848
pvcScanner.extraArgslist[]
pvcScanner.resources.requests.cpustring"50m"
pvcScanner.resources.requests.memorystring"50Mi"
pvcScanner.resources.limits.cpustring"500m"
pvcScanner.resources.limits.memorystring"200Mi"
dashboard.enabledbooltrue
dashboard.labels.grafana_dashboardstring"1"
dashboard.uidstring"b064425af1e711eb"
dashboard.titlestring"Kubernetes / Persistent Volumes (PVC-Exporter)"
dashboard.datasourcestring"-- Grafana --"
dashboard.timezonestring"UTC"
serviceMonitor.enabledboolfalse
serviceMonitor.additionalLabelsobject{}
prometheusRule.enabledboolfalse
prometheusRule.additionalLabelsobject{}
prometheusRule.percent.warningfloat0.7
prometheusRule.percent.criticalfloat0.9
prometheusRule.thresholds.absolutelist(object)see below
prometheusRule.thresholds.predictivelist(object)see below
templates[].enabledboolfalse
templates[].contentstring""

Templates

This chart provides a template render mechanism for rendering additional ressources bound to this release.

It works like bedag/raw helm chart but not on subchart level, see this example (values.yaml):

templates:
  - enabled: true
    content: |
      apiVersion: v1
      kind: ConfigMap
      metadata:
        name: {{ include "parent.fullname" . }}-additional
        labels:
          {{- include "parent.labels" . | nindent 4 }}
      data:
        example.data: |
          nothing special here
          out

Thresholds

There are two kinds of alerting thresholds, absolute and predictive. Both types allow effectively unlimited amount of instances to be defined, although more than two or three are rarely useful. You can define a set of labels for each instance to indicate things like severity.

While the first will trigger an alert on crossing a fixed usage percentage, the latter will attempt to predict the time how long (if ever) it will take to fill the volume.

Caution: Since duration values are parsed with golang's time.ParseDuration, the largest available unit is h. Thus, to express ex. 1d, you must use 24h and so on.

Absolute

Those alerts will trigger on usage crossing a flat percentage of the volume's total size for a given timespan.

By default, two alerts are defined:

  • less than 30% left for more than one hour, labelled severity: warning
  • less than 10% left for at least 15 minutes, labelled severity: critical
      - percentage: 30
        for: 1h
        labels:
          severity: warning
      - percentage: 10
        for: 15m
        labels:
          severity: critical

Predictive

Observing values over a given timeframe, a linear prediction is made on the expected usage at a future point in time. If the predicted value is at or below zero, indicating that the volume would be filled by then, an alert is raised.

By default the triggers are:

  • based on the last six hours, the disk would fill up in less than four days, labelled severity: warning
  • based on the last hour, the disk would fill up in less than one day, labelled severity: critical
      - interval: 9h
        target: 96h
        labels:
          severity: warning
      - interval: 3h
        target: 48h
        labels:
          severity: critical

Deploy pvc-exporter with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has pvc-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 chartpvc-exporter is pinned at v1.4.1 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