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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QLJfZQZeAKAwSqViTmLzki
This commit is contained in:
2026-10-17 21:43:49 +02:00
co-authored by Claude Opus 5.5
parent 84fb3aac21
commit 756ae65d0b
+16 -3
View File
@@ -85,21 +85,34 @@ spec:
mountPath: /etc/grafana/provisioning/dashboards mountPath: /etc/grafana/provisioning/dashboards
- name: dashboards - name: dashboards
mountPath: /var/lib/grafana/dashboards/mg4 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: readinessProbe:
httpGet: httpGet:
path: /api/health path: /api/health
port: http port: http
periodSeconds: 10 periodSeconds: 10
timeoutSeconds: 5
livenessProbe: livenessProbe:
httpGet: httpGet:
path: /api/health path: /api/health
port: http port: http
initialDelaySeconds: 30
periodSeconds: 30 periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 3
resources: resources:
requests: requests:
cpu: 50m cpu: 250m
memory: 128Mi memory: 256Mi
limits: limits:
memory: 512Mi memory: 512Mi
securityContext: securityContext: