Update structure of local-path for install/remove

This commit is contained in:
Adrien Reslinger 2020-04-22 15:01:14 +02:00
parent aa28df3bf6
commit 7cb826a8f1
4 changed files with 32 additions and 121 deletions

View file

@ -1,6 +1,9 @@
#!/bin/bash
wget https://raw.githubusercontent.com/rancher/local-path-provisioner/master/deploy/local-path-storage.yaml
kubernetes-split-yaml local-path-storage.yaml > generated.log
mv local{,.old}
mv generated local
cat generated.log | while read LIGNE; do if [ $(echo "${LIGNE}" | grep -c ^File) -eq 1 ]; then echo -n "${LIGNE} "; else echo "${LIGNE}"; fi; done | grep ^File | sort -V | sed 's|.*\(generated/\)\(.*\.yaml\)| - "local/\2"|'
sed 's|/opt/local-path-provisioner|/mnt/shared|' -i local/local-path-config-ConfigMap.yaml
sed 's|/opt/local-path-provisioner|/mnt/local|' -i local/local-path-config-ConfigMap.yaml
#mv local-path-storage.yaml local-path-storage_$(date +%Y%m%d).yaml
rm -fr local.old generated.log local-path-storage.yaml