feat(terraform): import Longhorn StorageClasses and app PVCs to Terraform state

- Phase 1: longhorn, longhorn-kafka StorageClasses (cluster-wide defaults)
- Phase 2 pilot: grafana, loki, portainer, forgejo PVCs
- All imports protected by lifecycle.prevent_destroy
- Removes Helm annotations (meta.helm.sh/*) to prevent dual-ownership conflicts
- Remote state backend (MinIO S3) syncs automatically on plan/apply
- Import-only approach: zero data loss, existing volumes untouched
- See terraform/LONGHORN_PVC_IMPORT.md for execution record

Co-Authored-By: Claude Haiku 4.5 <[email protected]>
This commit is contained in:
Story Crater Bot
2026-08-18 15:08:01 -07:00
co-authored by Claude Haiku 4.5
parent 3a7471fc9b
commit f2b6ad1c60
12 changed files with 770 additions and 1 deletions
+24
View File
@@ -0,0 +1,24 @@
# Grafana — persistent storage for dashboards and datasources
# Imported from live cluster state (import-only, no delete)
resource "kubernetes_persistent_volume_claim" "grafana" {
metadata {
name = "grafana"
namespace = "logging"
}
spec {
access_modes = ["ReadWriteOnce"]
storage_class_name = "longhorn"
resources {
requests = {
storage = "5Gi"
}
}
volume_name = "pvc-95f2216e-985d-4496-8b39-48e8c2a7f410"
}
lifecycle {
prevent_destroy = true
}
}