From 756ae65d0bdac6e07e334818a1bad415442b1b26 Mon Sep 17 00:00:00 2001 From: Nils Stinnesbeck Date: Sat, 17 Oct 2026 21:43:49 +0200 Subject: [PATCH] Grafana: startup probe so a slow first start is not killed Grafana's first start creates and migrates its database: 44 s at 0.5 CPU and 3 minutes at 0.1 CPU (measured with 13.2.3 on an empty volume). With only 50m requested, the liveness probe (30 s delay, 3 x 30 s) restarted it mid-migration, in a loop, and readiness never passed. - startupProbe on /api/health allows up to 10 minutes; liveness and readiness start only after it succeeds. - 5 s timeouts on all probes instead of the 1 s default. - Requests raised to 250m CPU / 256Mi (measured about 240 MB in use); still no CPU limit. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QLJfZQZeAKAwSqViTmLzki --- k8s/grafana.yaml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/k8s/grafana.yaml b/k8s/grafana.yaml index c3bb156..0032a52 100644 --- a/k8s/grafana.yaml +++ b/k8s/grafana.yaml @@ -85,21 +85,34 @@ spec: mountPath: /etc/grafana/provisioning/dashboards - name: dashboards mountPath: /var/lib/grafana/dashboards/mg4 + # The first start creates and migrates Grafana's database: measured 44 s at 0.5 CPU + # and 3 minutes at 0.1 CPU. The startup probe allows up to 10 minutes for that, and + # liveness/readiness only begin once it succeeded, so a slow first start is never + # killed mid-migration (which would restart it slowly again, in a loop). + startupProbe: + httpGet: + path: /api/health + port: http + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 60 readinessProbe: httpGet: path: /api/health port: http periodSeconds: 10 + timeoutSeconds: 5 livenessProbe: httpGet: path: /api/health port: http - initialDelaySeconds: 30 periodSeconds: 30 + timeoutSeconds: 5 + failureThreshold: 3 resources: requests: - cpu: 50m - memory: 128Mi + cpu: 250m + memory: 256Mi limits: memory: 512Mi securityContext: