The following procedure describes about creating the backup.

Procedure

  1. Configure the Velero AddOn.


  2. Log in to the VMware Telco Cloud Automation web interface.
  3. Navigate to Infrastructure > Virtual Infrastructure.
  4. Open the web terminal by clicking the Options (three dots) corresponding to the workload cluster you want to backup and then select Open Terminal.
  5. 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
  6. 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"
  7. 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>>
  8. 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
  9. Create a velero backup for the cluster resources having the above label:
    # velero backup create <harbor-cluster-resources-backup> --selector backup=harbor
  10. Get backup information and check whether all backup processes are Completed.
    # velero backup get