The following procedure describes about creating the backup.
Procedure
- Configure the Velero AddOn.
- Log in to the VMware Telco Cloud Automation web interface.
- Navigate to Infrastructure > Virtual Infrastructure.
- Open the web terminal by clicking the Options (three dots) corresponding to the workload cluster you want to backup and then select Open Terminal.
- On the web terminal, check the service health of Velero by running the following command:
# kubectl get pod -n velero # kubectl get bsl -n velero
- Set an environmental variable to exclude the cluster resources from backing up.
# export TCA_VELERO_EXCLUDE_RESOURCES="issuers.cert-manager.io,certificates.cert-manager.io,certificaterequests.cert-manager.io,gateways.networking.x-k8s.io,gatewayclasses.networking.x-k8s.io"
- Create a velero backup for all the resources present in the harbor namespace. Specify the namespaces where Harbor helm charts are deployed using option --include-namespaces.
velero backup create <harbor-namespaces-backup> --exclude-resources $TCA_VELERO_EXCLUDE_RESOURCES --include-namespaces <<comma-separated-harbor-helm-chart-namespaces>>
- Label all the Custom k8s resources (CRD, ValidatingWebhookConfiguration, and ingressclass) which are not deployed in Harbor namespace. These resources should be backed by using label selector.
-- Label the below cluster resources with key and value as backup=harbor # kubectl label crd bfdprofiles.metallb.io bgpadvertisements.metallb.io bgppeers.metallb.io communities.metallb.io servicel2statuses.metallb.io backup=harbor # kubectl label ValidatingWebhookConfiguration metallb-webhook-configuration backup=harbor # NGINX=$(kubectl get ValidatingWebhookConfiguration -o name | grep ingress-nginx-admission) # kubectl label $NGINX backup=harbor # kubectl label ingressclass nginx backup=harbor # velero backup create <harbor-cluster-resources-backup> --selector backup=harbor
- Create a velero backup for the cluster resources having the above label:
# velero backup create <harbor-cluster-resources-backup> --selector backup=harbor
- Get backup information and check whether all backup processes are Completed.
# velero backup get