pvc-exporter
by Mario-F
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
| Key | Type | Default | Description |
|---|---|---|---|
| image.repository | string | "ghcr.io/mario-f/pvc-exporter" | |
| image.repository | string | ".AppVersion" | |
| image.pullPolicy | string | "IfNotPresent" | |
| image.pullSecrets | list | [] | |
| serviceAccount.create | bool | false | |
| scrapeInterval | int | 15 | |
| pvcMapper.replicaCount | int | 1 | |
| pvcMapper.metricsPort | int | 8849 | |
| pvcMapper.extraArgs | list | [] | |
| pvcMapper.resources.requests.cpu | string | "100m" | |
| pvcMapper.resources.requests.memory | string | "50Mi" | |
| pvcMapper.resources.limits.cpu | string | "1000m" | |
| pvcMapper.resources.limits.memory | string | "200Mi" | |
| pvcScanner.metricsPort | int | 8848 | |
| pvcScanner.extraArgs | list | [] | |
| pvcScanner.resources.requests.cpu | string | "50m" | |
| pvcScanner.resources.requests.memory | string | "50Mi" | |
| pvcScanner.resources.limits.cpu | string | "500m" | |
| pvcScanner.resources.limits.memory | string | "200Mi" | |
| dashboard.enabled | bool | true | |
| dashboard.labels.grafana_dashboard | string | "1" | |
| dashboard.uid | string | "b064425af1e711eb" | |
| dashboard.title | string | "Kubernetes / Persistent Volumes (PVC-Exporter)" | |
| dashboard.datasource | string | "-- Grafana --" | |
| dashboard.timezone | string | "UTC" | |
| serviceMonitor.enabled | bool | false | |
| serviceMonitor.additionalLabels | object | {} | |
| prometheusRule.enabled | bool | false | |
| prometheusRule.additionalLabels | object | {} | |
| prometheusRule.percent.warning | float | 0.7 | |
| prometheusRule.percent.critical | float | 0.9 | |
| prometheusRule.thresholds.absolute | list(object) | see below | |
| prometheusRule.thresholds.predictive | list(object) | see below | |
| templates[].enabled | bool | false | |
| templates[].content | string | "" |
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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartpvc-exporter is pinned at v1.4.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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