From 547ca6d29bf5b53a17eb70f1a3dccfb6974b2884 Mon Sep 17 00:00:00 2001 From: Michael Karbowiak Date: Mon, 2 May 2022 16:32:21 +0200 Subject: [PATCH] Allow Longhorn and Hetzner CSI to live side by side, since Hetzner CSI takes over as default - we don't want Longhorn to also be default (It'll pick Hetzner simply because H comes before L) --- helm/longhorn.yaml | 2 +- init.tf | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/helm/longhorn.yaml b/helm/longhorn.yaml index 9c8c7a5..bd3e6f2 100644 --- a/helm/longhorn.yaml +++ b/helm/longhorn.yaml @@ -15,7 +15,7 @@ releases: chart: longhorn/longhorn values: - persistence: - defaultClass: true + defaultClass: {{ requiredEnv "HETZNER_CSI_DISABLED" }} defaultFsType: ext4 defaultClassReplicaCount: 2 - defaultSettings: diff --git a/init.tf b/init.tf index e16d02c..77ee7f7 100644 --- a/init.tf +++ b/init.tf @@ -181,6 +181,7 @@ resource "null_resource" "longhorn" { when = create command = <<-EOT export KUBECONFIG=$(readlink -f ${path.module}/kubeconfig.yaml) + export HETZNER_CSI_DISABLED=${var.disable_hetzner_csi ? "true" : "false"} helmfile -f ${path.module}/helm/longhorn.yaml apply EOT on_failure = continue