Exports helm release, chart, and version statistics in the prometheus format.
- Kubernetes 1.19+
- Helm 3+
helm repo add sstarcher https://shanestarcher.com/helm-charts/
helm repo updateSee helm repo for command documentation.
# Helm
$ helm install helm-exporter sstarcher/helm-exporterhelm install helm-exporter sstarcher/helm-exporterwill install and metrics should scrape automatically if prometheus is running- If using Grafana you can use this Dashboard to have a list of what's running https://grafana.com/grafana/dashboards/9367-helm-exporter
Two options exist for fetching the latest version information for a chart.
- Direct fetch from a chart repository. This will download the index for the registry and use that information to fetch the chart.
# Helm configuration
config:
helmRegistries:
overrideChartNames: {}
mysql: stable/test
# If the helm charts are not stored on hub.helm.sh then a custom registry can be configured here.
# Currently only index.yaml registry is supported (helm supports other registries as well)
override:
- registry:
url: "https://some.url" # Url to the index file
charts: # Chart names
- splunk
- falco-eks-audit-bridgeIf the registry needs authentication then you can use a Kubernetes secret to store the username and password.
kubectl create secret generic chartmuseum --from-literal=username=admin --from-literal=password=adminAnd use following configuration:
# Helm configuration
config:
helmRegistries:
overrideChartNames: {}
mysql: stable/test
# If the helm charts are not stored on hub.helm.sh then a custom registry can be configured here.
# Currently only index.yaml registry is supported (helm supports other registries as well)
override:
- registry:
url: "https://some.url" # Url to the index file
secretRef:
name: "chartmuseum" # Name of the secret containing the username and password
userKey: "username" # Key of the username in the secret
passKey: "password" # Key of the password in the secret
charts: # Chart names
- splunk
- falco-eks-audit-bridge- Query https://artifacthub.io for the chart matching your chart name and only using the specified registries. If no registry name is specified and multiple charts match from helm hub no version will be found and it will log a warning.
# Helm configuration
config:
helmRegistries:
registryNames:
- bitnamiRegistries can also be configured as OCI (Open Container Initiative) registries by prefixing the url with oci://. helm-exporter lists the tags published to the chart's OCI repository and reports the highest one as the latest version, the same way helm pull oci://... resolves chart versions.
# Helm configuration
config:
helmRegistries:
override:
- registry:
url: "oci://registry.example.com/helm" # OCI registry, no index.yaml involved
charts: # Chart names
- kube-prometheus-stack
- registry:
url: "oci://ghcr.io/prometheus-community/charts"
charts:
- kube-prometheus-stackPrivate OCI registries are supported the same way helm itself supports them: run helm registry login registry.example.com on a host (or in an init step) before starting helm-exporter, or point HELM_REGISTRY_CONFIG at an existing Helm registry credentials file. helm-exporter does not introduce a separate authentication mechanism for OCI - it reuses whatever credentials the Helm CLI would use.
# HELP helm_chart_info Information on helm releases
# TYPE helm_chart_info gauge
helm_chart_info{chart="ark",release="ark",version="1.2.1",latestVersion="1.2.3",appVersion="1.2.3",updated="1553201431",namespace="test"} 1
helm_chart_info{chart="cluster-autoscaler",release="cluster-autoscaler",version="0.7.0",latestVersion=7.3.2,appVersion="",updated="1553201431",namespace="other"} 4
helm_chart_info{chart="dex",release="dex",version="0.1.0",latestVersion="3.4.0",appVersion="1.2.3",updated="1553201431",namespace="test"} 1
# HELP helm_chart_outdated Outdated helm versions of helm releases
# TYPE helm_chart_outdated gauge
helm_chart_outdated{chart="ark",latestVersion="1.2.3",namespace="test",release="ark",version="1.2.1"} 1
helm_chart_outdated{chart="cluster-autoscaler",latestVersion="7.3.2",namespace="other",release="cluster-autoscaler",version="0.7.0"} 1
helm_chart_outdated{chart="external-secrets",latestVersion="3.4.0",namespace="test",release="dex",version="0.1.0"} 1
# HELP helm_chart_timestamp Timestamps of helm releases
# TYPE helm_chart_timestamp gauge
helm_chart_timestamp{chart="ark",release="ark",version="1.2.1",latestVersion="1.2.3",appVersion="1.2.3",updated="1553201431",namespace="test"} 1.617197959e+12
helm_chart_timestamp{chart="cluster-autoscaler",release="cluster-autoscaler",version="0.7.0",latestVersion=7.3.2,appVersion="",updated="1553201431",namespace="other"} 1.617196128e+12
helm_chart_timestamp{chart="dex",release="dex",version="0.1.0",latestVersion="3.4.0",appVersion="1.2.3",updated="1553201431",namespace="test"} 1.62245881e+12
The metric value is the helm status code. These status codes indexes do not map up directly to helm. This is so I can make the bad cases negative values.
- -1 FAILED
- 0 UNKNOWN
- 1 DEPLOYED
- 2 DELETED
- 3 SUPERSEDED
- 5 DELETING
- 6 PENDING_INSTALL
- 7 PENDING_UPGRADE
- 8 PENDING_ROLLBACK
- /healthz endpoint method