Files
homelab/terraform/longhorn.tf
T

29 lines
1.1 KiB
Terraform
Raw Normal View History

# Longhorn StorageClasses — app-specific variants only.
#
# The cluster-wide default `longhorn` SC is intentionally NOT managed here.
# It is owned by Longhorn's own setting-controller (reconciled from the
# `longhorn-storageclass` ConfigMap in longhorn-system, stamped with the
# `longhorn.io/last-applied-configmap` annotation). Managing it in Terraform
# caused a dual-ownership fight: TF strips the annotation, Longhorn re-adds it
# and delete+recreates the SC (params are immutable), racing TF's post-apply
# read ("Root object present, but now absent"). Longhorn recreates it
# automatically on any cluster, so it needs no TF representation.
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"
}
}