From b17a9a6949137470d800647d75ca8f7ba4e642c1 Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Mon, 2 Aug 2021 09:52:07 +0000 Subject: [PATCH] fix: set default storageClass on demand only --- charts/kubezero-metrics/values.yaml | 2 +- charts/kubezero-storage/templates/lvm-storageclass.yaml | 4 ++++ charts/kubezero-storage/values.yaml | 1 + charts/kubezero/templates/storage.yaml | 6 ++++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/charts/kubezero-metrics/values.yaml b/charts/kubezero-metrics/values.yaml index 89fd9511..d6693ac7 100644 --- a/charts/kubezero-metrics/values.yaml +++ b/charts/kubezero-metrics/values.yaml @@ -118,7 +118,7 @@ kube-prometheus-stack: storageSpec: volumeClaimTemplate: spec: - storageClassName: ebs-sc-gp3-xfs + # storageClassName: ebs-sc-gp3-xfs accessModes: ["ReadWriteOnce"] resources: requests: diff --git a/charts/kubezero-storage/templates/lvm-storageclass.yaml b/charts/kubezero-storage/templates/lvm-storageclass.yaml index af85e7ac..fb419cea 100644 --- a/charts/kubezero-storage/templates/lvm-storageclass.yaml +++ b/charts/kubezero-storage/templates/lvm-storageclass.yaml @@ -2,6 +2,10 @@ apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: openebs-lvm + {{- if .Values.storageClass.default }} + annotations: + storageclass.kubernetes.io/is-default-class: "true" + {{- end }} volumeBindingMode: WaitForFirstConsumer reclaimPolicy: Delete parameters: diff --git a/charts/kubezero-storage/values.yaml b/charts/kubezero-storage/values.yaml index 0ffcb160..eb5e1966 100644 --- a/charts/kubezero-storage/values.yaml +++ b/charts/kubezero-storage/values.yaml @@ -41,3 +41,4 @@ openebs: storageClass: vgpattern: "" + default: true diff --git a/charts/kubezero/templates/storage.yaml b/charts/kubezero/templates/storage.yaml index d9733736..c28062f9 100644 --- a/charts/kubezero/templates/storage.yaml +++ b/charts/kubezero/templates/storage.yaml @@ -1,4 +1,10 @@ {{- define "storage-values" }} + +{{- with index .Values "cert-manager" "storageClass" }} +storageClass: + {{- . | toYaml | nindent 2 }} +{{- end }} + {{- end }} {{- define "storage-argo" }}