set longhorn as default storageclass

This commit is contained in:
2024-04-07 21:10:32 +02:00
parent 1191fad431
commit 08e041ad6d
2 changed files with 20 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
resource "helm_release" "longhorn" {
count = var.install_longhorn ? 1 : 0
count = var.install_longhorn ? 1 : 0
namespace = "longhorn-system"
create_namespace = true
name = "longhorn"
@@ -11,3 +11,18 @@ resource "helm_release" "longhorn" {
# Helm chart deployment can sometimes take longer than the default 5 minutes
timeout = var.timeout_seconds
}
resource "kubernetes_annotations" "patch_oci-bv" {
count = var.install_longhorn ? 1 : 0
depends_on = [helm_release.longhorn]
api_version = "storage.k8s.io/v1"
kind = "StorageClass"
metadata {
name = "oci-bv"
}
annotations = {
"storageclass.kubernetes.io/is-default-class" = "false"
}
}

View File

@@ -8,5 +8,9 @@ terraform {
source = "hashicorp/helm"
version = ">= 2.12.1"
}
kubectl = {
source = "gavinbunney/kubectl"
version = ">= 1.14.0"
}
}
}