Fix Grafana CrashLoopBackOff -- disable loki-stack sidecar datasource #21

Merged
forgejo_admin merged 1 commit from 18-fix-grafana-duplicate-datasource-v3 into main 2026-03-06 13:10:46 +00:00

Summary

  • Fixes Grafana CrashLoopBackOff caused by duplicate default datasources
  • The loki-stack Helm chart auto-generates a ConfigMap with isDefault: true, conflicting with the kube-prometheus-stack default Prometheus datasource
  • Disables the loki-stack sidecar datasource so only the custom grafana-loki-datasource ConfigMap is used

Changes

  • terraform/main.tf: Added sidecar = { datasources = { enabled = false } } to the loki-stack Helm release's grafana block, preventing the chart from auto-provisioning a competing default datasource

Test Plan

  • tofu fmt -check passes (no formatting issues)
  • tofu validate -- requires provider init (not available in worktree); HCL is syntactically correct
  • tofu plan -- should show only the loki-stack Helm release updating
  • After apply: verify Grafana pod starts without CrashLoopBackOff
  • Verify Loki datasource still available via the custom grafana-loki-datasource ConfigMap

Review Checklist

  • Passed automated review-fix loop
  • No secrets committed
  • No unnecessary file changes
  • Commit messages are descriptive
  • todo-fix-grafana-duplicate-default-datasource -- the issue this PR addresses
  • Forgejo issue: #18
## Summary - Fixes Grafana CrashLoopBackOff caused by duplicate default datasources - The loki-stack Helm chart auto-generates a ConfigMap with `isDefault: true`, conflicting with the kube-prometheus-stack default Prometheus datasource - Disables the loki-stack sidecar datasource so only the custom `grafana-loki-datasource` ConfigMap is used ## Changes - `terraform/main.tf`: Added `sidecar = { datasources = { enabled = false } }` to the loki-stack Helm release's `grafana` block, preventing the chart from auto-provisioning a competing default datasource ## Test Plan - [x] `tofu fmt -check` passes (no formatting issues) - [ ] `tofu validate` -- requires provider init (not available in worktree); HCL is syntactically correct - [ ] `tofu plan` -- should show only the loki-stack Helm release updating - [ ] After apply: verify Grafana pod starts without CrashLoopBackOff - [ ] Verify Loki datasource still available via the custom `grafana-loki-datasource` ConfigMap ## Review Checklist - [x] Passed automated review-fix loop - [x] No secrets committed - [x] No unnecessary file changes - [x] Commit messages are descriptive ## Related Notes - `todo-fix-grafana-duplicate-default-datasource` -- the issue this PR addresses - Forgejo issue: #18
The loki-stack Helm chart auto-generates a ConfigMap with isDefault: true,
conflicting with the kube-prometheus-stack default datasource. Disable the
loki-stack sidecar datasource provisioning so only the custom
grafana-loki-datasource ConfigMap (isDefault: false) is used.

Closes #18

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
forgejo_admin deleted branch 18-fix-grafana-duplicate-datasource-v3 2026-03-06 13:10:46 +00:00
Sign in to join this conversation.
No description provided.