update velero install script
This commit is contained in:
parent
068ed69afb
commit
efe98915c6
1 changed files with 51 additions and 10 deletions
|
@ -1,4 +1,10 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
###################
|
||||||
|
AWSVERSION=v1.7.1
|
||||||
|
CSIVERSION=v0.5.1
|
||||||
|
BUCKET=yolokube-velero
|
||||||
|
S3URL=https://38a7c29ab4f869c340784d3d7aaa0f62.r2.cloudflarestorage.com
|
||||||
|
###################
|
||||||
command_exists() {
|
command_exists() {
|
||||||
command -v "$1" >/dev/null 2>&1
|
command -v "$1" >/dev/null 2>&1
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
|
@ -6,14 +12,49 @@ command_exists() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
echo "check if velero is installed"
|
echo -n "check if velero is installed"
|
||||||
command_exists "velero"
|
command_exists "velero"
|
||||||
echo "install velero to the cluster"
|
echo ": done"
|
||||||
|
if [ ! -f ./credentials ]; then
|
||||||
|
echo "credentials file is missing, aborting"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
PS3='Please enter your choice: '
|
||||||
|
options=("Install velero with CSI plugins" "Install velero without CSI plugins" "Install CSI Plugins only" "Quit")
|
||||||
|
select opt in "${options[@]}"
|
||||||
|
do
|
||||||
|
case $opt in
|
||||||
|
"Install velero with CSI plugins")
|
||||||
velero install \
|
velero install \
|
||||||
--provider aws \
|
--provider aws \
|
||||||
--features=EnableCSI \
|
--features=EnableCSI \
|
||||||
--plugins velero/velero-plugin-for-aws:v1.7.1,velero/velero-plugin-for-csi:v0.5.1 \
|
--plugins velero/velero-plugin-for-aws:${AWSVERSION},velero/velero-plugin-for-csi:${CSIVERSION} \
|
||||||
--bucket yolokube-velero \
|
--bucket ${BUCKET} \
|
||||||
--secret-file ./credentials \
|
--secret-file ./credentials \
|
||||||
--use-volume-snapshots=false \
|
--use-volume-snapshots=false \
|
||||||
--backup-location-config region=weur,s3ForcePathStyle="true",s3Url=https://38a7c29ab4f869c340784d3d7aaa0f62.r2.cloudflarestorage.com
|
--backup-location-config region=weur,s3ForcePathStyle="true",s3Url=${S3URL}
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
"Install velero without CSI plugins")
|
||||||
|
velero install \
|
||||||
|
--provider aws \
|
||||||
|
--plugins velero/velero-plugin-for-aws:${AWSVERSION} \
|
||||||
|
--bucket ${BUCKET} \
|
||||||
|
--secret-file ./credentials \
|
||||||
|
--use-volume-snapshots=false \
|
||||||
|
--backup-location-config region=weur,s3ForcePathStyle="true",s3Url=${S3URL}
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
"Install CSI Plugins only")
|
||||||
|
velero plugin add velero/velero-plugin-for-csi:${CSIVERSION}
|
||||||
|
velero client config set features=EnableCSI
|
||||||
|
echo "done"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
"Quit")
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
*) echo "invalid option $REPLY";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
exit 1
|
Loading…
Reference in a new issue