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:
co-authored by
Claude Haiku 4.5
parent
3a7471fc9b
commit
f2b6ad1c60
@@ -0,0 +1,40 @@
|
||||
# Longhorn StorageClasses — cluster-wide default + app-specific variants
|
||||
# Imported from live cluster state (import-only, no delete)
|
||||
|
||||
resource "kubernetes_storage_class" "longhorn" {
|
||||
metadata {
|
||||
name = "longhorn"
|
||||
}
|
||||
storage_provisioner = "driver.longhorn.io"
|
||||
reclaim_policy = "Delete"
|
||||
allow_volume_expansion = true
|
||||
volume_binding_mode = "Immediate"
|
||||
|
||||
parameters = {
|
||||
numberOfReplicas = "3"
|
||||
staleReplicaTimeout = "60"
|
||||
fromBackup = ""
|
||||
fsType = "ext4"
|
||||
dataLocality = "disabled"
|
||||
disableRevisionCounter = "true"
|
||||
unmapMarkSnapChainRemoved = "ignored"
|
||||
}
|
||||
}
|
||||
|
||||
resource "kubernetes_storage_class" "longhorn_kafka" {
|
||||
metadata {
|
||||
name = "longhorn-kafka"
|
||||
}
|
||||
storage_provisioner = "driver.longhorn.io"
|
||||
reclaim_policy = "Delete"
|
||||
allow_volume_expansion = true
|
||||
volume_binding_mode = "Immediate"
|
||||
|
||||
parameters = {
|
||||
numberOfReplicas = "3"
|
||||
staleReplicaTimeout = "30"
|
||||
fromBackup = ""
|
||||
fsType = "ext4"
|
||||
dataLocality = "disabled"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user