wiking-monitoring
by DataLead
Production-grade observability stack — Prometheus, Loki, Promtail, Grafana, with bundled exporters and IOMETE-aware Spark dashboards
About this chart
wiking-monitoring
Helm chart packaging an observability stack: Prometheus, Loki, Promtail (or Alloy), Tempo, Grafana, Pushgateway, node-exporter, kube-state-metrics, kubernetes-event-exporter, x509-certificate-exporter, and four small in-cluster exporters for Spark / PVC / Typesense metrics. Exporters are discovered through prometheus.io/scrape annotations on their Services; Grafana dashboards, datasources and alert rules are provisioned from ConfigMaps (no UI configuration).
This README covers 1.0.8. If you upgrade a running release, read Upgrading to 1.0.8 first.
Components and versions
Default image tags from values.yaml. Images under registrydl.datalead.az/datalead/devops/wiking-monitoring/ live in a private registry and need an image pull secret (see Environment prerequisites).
| Component | Values key | Default | Image (default tag) |
|---|---|---|---|
| Prometheus | prometheus | on | registrydl.datalead.az/datalead/devops/wiking-monitoring/prometheus:v3.5.3 |
| Loki | loki | on | registrydl.datalead.az/datalead/devops/wiking-monitoring/loki:3.7.2 |
| Promtail | promtail | on | registrydl.datalead.az/datalead/devops/wiking-monitoring/promtail:3.6.11 |
| Alloy (alternative to Promtail) | alloy | off | registrydl.datalead.az/datalead/devops/wiking-monitoring/alloy:v1.5.1 |
| Tempo | tempo | off | registrydl.datalead.az/datalead/devops/wiking-monitoring/tempo:2.7.2 |
| Grafana | grafana | on | registrydl.datalead.az/datalead/devops/wiking-monitoring/grafana:12.4.3 |
| Grafana sidecars (dashboards, datasources, IOMETE RBAC reconciler) | grafana.sidecar | on | registrydl.datalead.az/datalead/devops/wiking-monitoring/k8s-sidecar:2.7.3 |
| node-exporter | nodeExporter | on | registrydl.datalead.az/datalead/devops/wiking-monitoring/node-exporter:v1.11.1 |
| kube-state-metrics | kubeStateMetrics | on | registrydl.datalead.az/datalead/devops/wiking-monitoring/kube-state-metrics:v2.18.0 |
| kubernetes-event-exporter | eventExporter | off | registrydl.datalead.az/datalead/devops/wiking-monitoring/kubernetes-event-exporter:v1.7 |
| x509-certificate-exporter | x509Exporter | off | registrydl.datalead.az/datalead/devops/wiking-monitoring/x509-certificate-exporter:3.21.0 |
| spark-executor-disk-exporter | sparkExecutorExporter | off | collector registrydl.datalead.az/datalead/devops/wiking-monitoring/k8s:1.34.8, web registrydl.datalead.az/datalead/devops/wiking-monitoring/busybox:1.36 |
| spark-disk-watcher | sparkDiskWatcher | off | registrydl.datalead.az/datalead/devops/wiking-monitoring/spark-disk-watcher:1.0.1 |
| local-path-exporter (PVC usage on hostPath volumes) | localPathExporter | off | busybox:1.36 (collector and web) |
| typesense-exporter | typesenseExporter | off | registrydl.datalead.az/datalead/devops/wiking-monitoring/typesense-exporter:1.0.2 |
| Pushgateway | pushgateway | off | registrydl.datalead.az/datalead/devops/wiking-monitoring/pushgateway:v1.11.2 |
| Pre-upgrade hook (kubectl) | upgradeHooks.orphanLegacyStatefulSets | on | falls back to the sparkExecutorExporter.collector.image (k8s:1.34.8) |
IOMETE-specific parts (iomete.*, the IOMETE dashboards, the Spark exporters, the auto-login EnvoyFilter) are all off by default.
Architecture
annotated pods / Services --scrape--> Prometheus (StatefulSet) --remote_write--> Thanos / Mimir (optional)
node-exporter, kube-state-metrics, x509, event-exporter, spark/pvc/typesense exporters
batch jobs --push--> Pushgateway (optional) --scrape--> Prometheus
/var/log/pods, journal --> Promtail or Alloy (DaemonSet) --push--> Loki (StatefulSet; S3 for HA)
OTLP traces ------------------------------------------------> Tempo (optional)
Grafana (Deployment) <-- datasources: Prometheus, Loki, Tempo
sidecar: dashboards from ConfigMaps labelled grafana_dashboard="1"
sidecar: IOMETE RBAC reconciler (when iomete.grafanaAutoLogin.rbac.enabled)
Design decisions:
| Concern | Decision |
|---|---|
| Scrape discovery | Annotation based (kubernetes-service-endpoints, kubernetes-pods). Static targets only in prometheus.additionalScrapeConfigs. |
| Kubelet / cAdvisor | Scraped directly on nodeIP:10250 (prometheus.kubeletScrape.mode: direct); nodes/proxy is not in the RBAC. |
| Local TSDB retention | prometheus.retention 24h by default; retentionSize defaults to about 85% of the PVC. Long term: remote-write. |
| Loki schema | tsdb v13, immutable after the first write. Prod storage is S3-compatible object storage. |
| Dashboards | k8s-sidecar watches ConfigMaps with grafana_dashboard: "1". Dashboard JSON lives in dashboards/. |
| Secrets | Referenced by name (secretKeyRef / existingSecret / envFromSecret). Nothing secret in values.yaml. |
Environment prerequisites
Check these before the first install. Most of them fail quietly (a pod stuck in ImagePullBackOff, a watcher that misses events, an EnvoyFilter that is never applied).
| Requirement | Notes |
|---|---|
| Kubernetes >= 1.25, Helm >= 3.10 | CI renders and validates against the 1.25 and 1.30 schemas. |
StorageClass with ReadWriteOnce | Prometheus, Loki, Tempo and Grafana use PVCs. storageClass is immutable once a PVC is bound. NFS and other storage that ignores fsGroup needs prometheus.initChown.enabled: true (Grafana: grafana.initChown.enabled). |
| Grafana admin Secret | grafana.adminSecret.existingSecret (default grafana-admin-secret, keys admin-user, admin-password) must exist before install. |
| Loki S3 Secret (prod) | loki-s3-secret with access_key_id / secret_access_key, or workload identity. |
Install access (images need a deploy token)
The chart is public over HTTP; the OCI chart and every default image are private. Ask datalead for a deploy token (scope read_registry) to pull the images (and, optionally, the OCI chart).
helm repo add datalead https://charts.datalead.az
helm install wiking-monitoring datalead/wiking-monitoring -n observability --create-namespace
# or OCI (deploy token)
helm registry login registrydl.datalead.az -u <deploy-token-user>
helm install wiking-monitoring oci://registrydl.datalead.az/datalead/devops/wiking-monitoring/charts/wiking-monitoring -n observability
Images: the default images come from registrydl.datalead.az/datalead/devops/wiking-monitoring/. global.imagePullSecrets defaults to a secret named registry-wiking, which must exist in the release namespace before install:
kubectl create secret docker-registry registry-wiking --docker-server=registrydl.datalead.az --docker-username=<deploy-token-user> --docker-password=<deploy-token> -n observability
The value is a list of {name: ...} objects, not strings:
global:
imagePullSecrets:
- name: registry-wiking
It is applied to the chart's pods, including the upgrade hook Job. To pull from your own mirror, override the *.image.repository values.
Flux and Argo CD need no credentials for https://charts.datalead.az. For OCI: Flux HelmRepository type: oci with spec.secretRef; Argo CD a repository Secret with enableOCI: "true", url: registrydl.datalead.az/datalead/devops/wiking-monitoring/charts, username, password.
inotify limits (spark-disk-watcher)
sparkDiskWatcher uses inotify against each tracked Spark executor emptyDir on every node. Linux defaults for fs.inotify.max_user_instances (128 on many distros) can be exhausted on busy Spark nodes. Raise the limits on the nodes that run it, for example:
fs.inotify.max_user_instances = 512
fs.inotify.max_user_watches = 524288
These numbers are a sizing suggestion, not a chart default; apply them through your node image or a sysctl DaemonSet. The watcher emits a HEARTBEAT log line each cycle, and the SparkDiskWatcherSilent alert fires when it stops.
Istio
If the namespace is Istio-injected:
- Grafana auto-login for IOMETE needs sidecar injection on the Grafana pod. Declare it with
grafana.podLabels: {sidecar.istio.io/inject: "true"}, oriomete.grafanaAutoLogin.namespaceInjection: true(you assert that the namespace carriesistio-injection=enabledoristio.io/rev). Without one of them the render fails; thegrafana.podAnnotationsform alone is rejected because it injects nothing in an unlabelled namespace. Stock IOMETE runs iom-core without a sidecar, so keepiomete.grafanaAutoLogin.sourceRestriction.enabled: false(default) unless the IOMETE proxy is meshed. - Kubelet scrape. An Envoy sidecar on Prometheus would capture outbound
:10250and break the direct TLS scrape.prometheus.istio.excludeKubeletPort: true(default) addstraffic.sidecar.istio.io/excludeOutboundPorts: "10250"to the Prometheus pod. - Probes. Probe
timeoutSecondsbelow 5 caused liveness kills behind a sidecar. Chart defaults are >= 5 and the schema enforces it for Grafana and the exporters. - Hook Job. The pre-upgrade Job must not get a sidecar (it would never complete). See the hook section below.
- Peer ports use
tcp-names (Loki memberlist istcp-memberlist).
EnvoyFilter CRD (IOMETE auto-login)
iomete.grafanaAutoLogin.enabled: true renders an Istio EnvoyFilter (networking.istio.io/v1alpha3). The render fails when that CRD is not installed. helm template and other offline renders cannot discover CRDs, so pass:
helm template wiking-monitoring . -f values.yaml -f my-values.yaml \
--api-versions networking.istio.io/v1alpha3/EnvoyFilter
The filter is the trust boundary for the auto-login header. After the first install verify on the cluster that a request with Host: evil and X-WEBAUTH-USER: admin returns 401.
hostPath requirements
| Component | hostPath | Notes |
|---|---|---|
| promtail / alloy | /var/log/pods, /var/log (read-only), journal | Journal: an init container links /journal/{var,run} to the host /var/log/journal or /run/log/journal when present, otherwise to an empty dir. The chart never creates /var/log/journal. Promtail keeps positions in /var/lib/promtail. |
| node-exporter | host root (read-only), hostNetwork, hostPID | Optional textfile collector dir /var/lib/node_exporter/textfile_collector. |
| localPathExporter | localPathExporter.hostPaths (default /opt/local-path-provisioner) | hostPathType: DirectoryOrCreate (default) creates an empty root-owned directory on every node the DaemonSet lands on. Use Directory plus nodeSelector/tolerations to forbid that. OpenEBS hostpath (pvc-<uuid> names only) is not supported; those directories are counted in pvc_hostpath_exporter_skipped_dirs. |
| sparkDiskWatcher | /var/lib/kubelet/pods (read-only) | Some cluster pod-security policies reject this mount, which is why it is opt-in. |
Nodes for Loki HA
values-prod.yaml runs Loki with 3 replicas, hard pod anti-affinity and a PDB with minAvailable: 2. That needs 3 schedulable nodes. With 2 replicas the write quorum is 2 of 2, so draining one node stops ingestion. HA also requires S3-compatible object storage (loki.storage.type: s3); filesystem with replicas > 1 fails the render.
Install
Services are ClusterIP. Expose Grafana through an Ingress with TLS; NodePort is not a supported deployment pattern.
1. Secrets
kubectl create namespace observability
kubectl create secret generic grafana-admin-secret \
--from-literal=admin-user=admin \
--from-literal=admin-password='<strong-password>' \
-n observability
# plus registry-wiking (see above) and, for prod, loki-s3-secret
In production provision these with External Secrets Operator or Vault (example: docs/examples/external-secrets-vault.yaml). Grafana applies the admin password only when it first creates the admin user; later changes must be made in Grafana (or with grafana cli admin reset-admin-password) and in the Secret.
2. Overlay with Ingress and TLS
# my-values.yaml
grafana:
externalUrl: https://monitoring.example.com/
ingress:
enabled: true
className: nginx
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
hosts:
- host: monitoring.example.com
paths:
- path: /
pathType: Prefix
tls:
- hosts: [monitoring.example.com]
secretName: monitoring-tls
Prometheus and Pushgateway have no authentication. Do not publish their Ingress without an auth layer in front.
3. Install
helm upgrade --install wiking-monitoring . \
-f values.yaml -f my-values.yaml \
--namespace observability --create-namespace \
--atomic --timeout 10m
For production start from values-prod.yaml (HA, S3 Loki, external Postgres for Grafana, remote-write); its secret and endpoint values are placeholders you must replace.
Quick check without an Ingress:
kubectl -n observability port-forward svc/wiking-monitoring-grafana 3000:3000
kubectl -n observability port-forward svc/wiking-monitoring-prometheus 9090:9090
Upgrading to 1.0.8
Applies to releases on 1.0.7, 1.0.8-rc3 and 1.0.8-rc5.
1. StatefulSet volumeClaimTemplates (pre-upgrade hook)
Charts up to 1.0.8-rc5 put helm.sh/chart and app.kubernetes.io/version into the volumeClaimTemplates labels of the Prometheus, Loki and Tempo StatefulSets. volumeClaimTemplates are immutable, so upgrading such a release fails with StatefulSet ... spec: Forbidden, and every later chart bump would fail the same way.
1.0.8 ships a pre-upgrade hook Job (<fullname>-upgrade-orphan-sts, with a ServiceAccount, Role and RoleBinding limited to StatefulSets in the namespace). For each of the three StatefulSets it compares the live volumeClaimTemplates (names and labels) with what the chart renders and,
Deploy wiking-monitoring with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has wiking-monitoring 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 chartwiking-monitoring is pinned at v1.0.8-rc9 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