63 lines
1.2 KiB
YAML
63 lines
1.2 KiB
YAML
kind: ConfigMap
|
|
apiVersion: v1
|
|
metadata:
|
|
name: local-path-config
|
|
namespace: kube-system
|
|
data:
|
|
config.json: |-
|
|
{
|
|
"nodePathMap":[
|
|
{
|
|
"node":"DEFAULT_PATH_FOR_NON_LISTED_NODES",
|
|
"paths":["/var/lib/rancher/k3s/storage"]
|
|
}
|
|
{
|
|
"node":"r720xd",
|
|
"paths":["/mnt/MainPool/Kubernetes/local-path-provisioner"]
|
|
}
|
|
]
|
|
}
|
|
helperPod.yaml: |-
|
|
apiVersion: v1
|
|
kind: Pod
|
|
metadata:
|
|
name: helper-pod
|
|
spec:
|
|
containers:
|
|
- name: helper-pod
|
|
image: rancher/mirrored-library-busybox:1.37.0
|
|
setup: |-
|
|
#!/bin/sh
|
|
while getopts "m:s:p:" opt
|
|
do
|
|
case $opt in
|
|
p)
|
|
absolutePath=$OPTARG
|
|
;;
|
|
s)
|
|
sizeInBytes=$OPTARG
|
|
;;
|
|
m)
|
|
volMode=$OPTARG
|
|
;;
|
|
esac
|
|
done
|
|
mkdir -m 0777 -p ${absolutePath}
|
|
chmod 701 ${absolutePath}/..
|
|
teardown: |-
|
|
#!/bin/sh
|
|
while getopts "m:s:p:" opt
|
|
do
|
|
case $opt in
|
|
p)
|
|
absolutePath=$OPTARG
|
|
;;
|
|
s)
|
|
sizeInBytes=$OPTARG
|
|
;;
|
|
m)
|
|
volMode=$OPTARG
|
|
;;
|
|
esac
|
|
done
|
|
rm -rf ${absolutePath} |