Skip to content

Instantly share code, notes, and snippets.

@i386kernel
Last active September 15, 2021 12:47
Show Gist options
  • Select an option

  • Save i386kernel/083cfe07817c6fb16f3a4c921c4e22df to your computer and use it in GitHub Desktop.

Select an option

Save i386kernel/083cfe07817c6fb16f3a4c921c4e22df to your computer and use it in GitHub Desktop.
This Shell script sets up Docker, Minio and Velero
#!/bin/bash
echo " "
echo "===============Script to setup Docker, Minio, NFS and Environment for Velero - Lakshya Nanjangud=============="
echo " "
echo " "
echo "---Downloading and Installing Docker---"
echo " "
sudo yum install docker
echo "---Running Docker Service---"
sudo systemctl start docker.service
echo " "
echo "---Creating Volumes for Minio---"
docker volume create miniovolume
echo " "
echo "---Inspecting docker Volume---"
docker volume inspect miniovolume
echo " "
echo "---Getting and running minio object store container---"
docker run -d --rm -p 9999:9000 --name minios3 -e "MINIO_ACCESS_KEY=minio" -e "MINIO_SECRET_KEY=minio123" -v miniovolume:/data minio/minio server miniovolume
echo " "
echo "---Setting up NFS---"
echo " "
yum install -y nfs-utils nfs-utils-lib
systemctl start nfs
chkconfig --level 35 nfs on
echo " "
echo "---Downloading Velero 1.5.2 Version---"
wget https://github.com/vmware-tanzu/velero/releases/download/v1.5.2/velero-v1.5.2-linux-amd64.tar.gz
echo " "
echo "---Decompressing velero gzipped file---"
gzip -d velero-v1.5.2-linux-amd64.tar.gz
echo " "
echo "Untaring file"
tar -xvf velero-v1.5.2-linux-amd64.tar
cd velero-v1.5.2-linux-amd64/
echo " "
echo "---Setting up Velero Environment for installation---"
echo "[default]
aws_access_key_id = minio
aws_secret_access_key = minio123" >> credentials-velero
echo " "
echo "--Minio Container Inspect--"
docker container inspect $(docker container ls | awk 'NR == 2{print $1}')
echo " "
echo "---Docker Service Status---"
systemctl status docker.service
echo " "
echo "---Minio Docker Container Status---"
echo " "
docker container ls
echo " "
echo "---NFS Status---"
systemctl status nfs
echo " "
echo "---Now you can go ahead and install Velero---"
echo " "
echo " "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment