s3-exporter

by FZJ ICE-1

Helm chartv1.1.0App 1.0.2MITVerified publisher

Prometheus exporter for bucket usage on S3-compatible storage

About this chart

S3 Prometheus Exporter

This chart creates a deployment of the s3-exporter, a Prometheus exporter that reports object count, size and more per bucket for S3-compatible storage.

Requirements

It is required to have a running S3-compatible storage and to create a secret with the access credentials:

apiVersion: v1
kind: Secret
metadata:
  name: s3-exporter-secret
  namespace: monitoring
type: Opaque
stringData:
  accessKey: access-key
  secretKey: secret-key

The credentials only require read permissions for the buckets. Buckets that are not visible to the user are not reported.

When enabling the podMonitor/prometheusRule the Prometheus Operator CRDs need to be present (e.g. kube-prometheus-stack).

A missing CRD is handled according to corresponding .renderMode:

ModeBehavior when the CRD is missing
skipIfMissing(default) Skip CR rendering
failIfMissingFail Chart deployment
alwaysRenderAlways render the CR

Prometheus only selects monitors matching its podMonitorSelector, which usually requires the release label of the monitoring stack.
It can be added via podMonitor.additionalLabels:

kubectl get prometheus -n monitoring -o yaml | grep -A5 podMonitorSelector

Installing the Chart

Using Helm Install via Repository

Add the repository as described here.

# Install latest Version
helm repo update
helm upgrade -i -n monitoring s3-exporter ict-platform/s3-exporter -f values.yaml
# List available versions
helm search repo ict-platform --versions
# Install specific version
helm install -n monitoring s3-exporter ict-platform/s3-exporter --version <x.x.x> -f values.yaml

Using OCI Container Registry

# Show the default values
helm show values oci://jugit-registry.fz-juelich.de/iek-10/public/ict-platform/deployment/kubernetes/helm-charts/s3-exporter --version <x.x.x>
# Show the rendered manifests with your values
helm template -n vernemq vernemq oci://jugit-registry.fz-juelich.de/iek-10/public/ict-platform/deployment/kubernetes/helm-charts/s3-exporter --version <x.x.x> -f values.yaml
# Install
helm upgrade -i -n vernemq vernemq oci://jugit-registry.fz-juelich.de/iek-10/public/ict-platform/deployment/kubernetes/helm-charts/s3-exporter --version <x.x.x> -f values.yaml

Using Rancher

Follow the steps described here.
The chart can than be installed through the Apps option in the rancher dashboard.

Deploy s3-exporter with OpenTenant

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