So far in this series of blogs, we have installed MinIO on a Ubuntu server, installed the Data Manager and the Velero vSphere Operator on the Supervisor cluster.
We will continue in our journey to backup and restore a vSphere pod. The next step would be to install the vSphere plugin for Velero.
Step 1: Login to the Linux Jump host from where you access the Supervisor Cluster. Alternatively, you can setup a Linux machine to just install the CLI and use it only for backup and restore operations, which is optional. Once logged in, download the plugin from here.
Step 2: Extract the CLI and make it an executable file using the commands below.
tar -xf velero-vsphere-1.1.0-linux-amd64.tar.gz
chmod +x velero-vsphere–1.1.0-linux-amd64
Step 3: Create a credentials file (s3credentials) with the MinIO credentials that were specified during installation. (Step 7 from blog 1)
aws_access_key_id = <USERNAME>
aws_secret_access_key = <PASSWORD>
Step 4: Login to the supervisor cluster using kubectl and switch the context to the velero namespace created after the operator installation. (Step 5 from blog 2)
kubectl config use-context velero
Step 5: Create an YAML file using the contents below and create the config map using kubectl apply -f <filename>
apiVersion: v1
kind: ConfigMap
metadata:
name: velero-vsphere-plugin-config
data:
cluster_flavor: SUPERVISOR
Step 6: Once the config map is created, please use the following command to complete the installation of the plugin. If you are using an other Object Storage platform apart from MinIO then the command needs to be updated accordingly.
velero-vsphere install --namespace velero --version v1.5.1 --provider aws --plugins velero/velero-plugin-for-aws:v1.1.0,vsphereveleroplugin/velero-plugin-for-vsphere:1.1.0 --bucket my-cluster-backups --secret-file /tmp/s3credentials --snapshot-location-config region=minio --backup-location-config region=minio,s3ForcePathStyle="true",s3Url=http://192.168.xx.xx
where 192.168.xx.xx is the IP of my MinIO server. Also please note, you can modify the velero-plugin-for-vsphere to use 1.1.0 or 1.2.0 according to your vCenter version, however the velero version must always be v1.5.1.
Step 7: Once the installation is successful, you will see the following message
“Send the request to the operator about installing Velero in namespace velero”
At this point, we have successfully installed the plugin and now we can use the plugin to backup a pod.
Troubleshooting the deployment
Once the installation was complete, when I did a “velero get backup-locations“, I was returned with an “Unavailable” phase. This should have ideally been Available. So what went wrong?
When i initiated a backup I noticed it failed and when I described the backup logs I got the following error message:
An error occurred: Get “http://192.168.xx.xx/my-cluster-backups/backups/test-nginx-backup-logs.gz?X-Amz…”:dial tcp 192.168.xx.xx:80: connect: connection refused
which is when I realized I had installed the plugin with s3 url as http://192.168.xx.xx instead of http://192.168.xx.xx:9000.
So, instead of going through the whole procedure of uninstalling and installing again, since the backup storage location is a custom resource definition that got created within the supervisor cluster, we can just edit it using the following command and update the s3URL. Before we edit it, we can confirm if the bsl has got created using kubectl get.
kubectl edit bsl -n velero
As soon as I edited the s3Url, the status got updated as Available as shown in the image below.
That concludes the installation portion for velero. We are now ready to backup vSphere pods, which will be covered in the final blog in the series.
Happy Learning!
One comment