diff --git a/clusters/kairos/storage/kustomization.yaml b/clusters/kairos/storage/kustomization.yaml index f27e332..bc24996 100644 --- a/clusters/kairos/storage/kustomization.yaml +++ b/clusters/kairos/storage/kustomization.yaml @@ -1,4 +1,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: -- storageclass.yaml \ No newline at end of file +- localstorageconfigmap.yaml \ No newline at end of file diff --git a/clusters/kairos/storage/localstorageconfigmap.yaml b/clusters/kairos/storage/localstorageconfigmap.yaml new file mode 100644 index 0000000..01789c4 --- /dev/null +++ b/clusters/kairos/storage/localstorageconfigmap.yaml @@ -0,0 +1,34 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + name: local-path-config + namespace: kube-system +data: + config.json: |- + { + "nodePathMap":[ + { + "node":"DEFAULT_PATH_FOR_NON_LISTED_NODES", + "paths":["/usr/local"] + } + ] + } + helperPod.yaml: |- + apiVersion: v1 + kind: Pod + metadata: + name: helper-pod + spec: + containers: + - name: helper-pod + image: "rancher/mirrored-library-busybox:1.36.1" + imagePullPolicy: IfNotPresent + setup: |- + #!/bin/sh + set -eu + mkdir -m 0777 -p "${VOL_DIR}" + chmod 700 "${VOL_DIR}/.." + teardown: |- + #!/bin/sh + set -eu + rm -rf "${VOL_DIR}" \ No newline at end of file diff --git a/clusters/kairos/storage/storageclass.yaml b/clusters/kairos/storage/storageclass.yaml deleted file mode 100644 index 24ad121..0000000 --- a/clusters/kairos/storage/storageclass.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: storage.k8s.io/v1 -kind: StorageClass -metadata: - name: local-storage - annotations: - storageclass.kubernetes.io/is-default-class: "true" -provisioner: rancher.io/local-path -parameters: - nodePath: /usr/local - pathPattern: "{{ .PVC.Namespace }}/{{ .PVC.Name }}" -reclaimPolicy: Retain \ No newline at end of file