From 70dc631e84de31acaf56c8ad9af9dcfc5ed06f3b Mon Sep 17 00:00:00 2001 From: Marco van Zijl Date: Fri, 9 May 2025 20:13:10 +0200 Subject: [PATCH] Add local storage configuration with Kustomize for Rancher local-path provisioner --- applications/templates/local-storage.yaml | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 applications/templates/local-storage.yaml diff --git a/applications/templates/local-storage.yaml b/applications/templates/local-storage.yaml new file mode 100644 index 0000000..75a79b3 --- /dev/null +++ b/applications/templates/local-storage.yaml @@ -0,0 +1,36 @@ +# kustomization.yaml +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- github.com/rancher/local-path-provisioner/deploy?ref=v0.0.26 +patches: +- patch: |- + kind: ConfigMap + apiVersion: v1 + metadata: + name: local-path-config + namespace: local-path-storage + data: + config.json: |- + { + "nodePathMap":[ + { + "node":"DEFAULT_PATH_FOR_NON_LISTED_NODES", + "paths":["/var/mnt/local-path-provisioner"] + } + ] + } +- patch: |- + apiVersion: storage.k8s.io/v1 + kind: StorageClass + metadata: + name: local-path + annotations: + storageclass.kubernetes.io/is-default-class: "false" +- patch: |- + apiVersion: v1 + kind: Namespace + metadata: + name: local-path-storage + labels: + pod-security.kubernetes.io/enforce: privileged \ No newline at end of file