Error: "Velero has already been installed" when attempting to backup a Kubernetes cluster in OSE
search cancel

Error: "Velero has already been installed" when attempting to backup a Kubernetes cluster in OSE

book

Article ID: 405726

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • Backup of VMware Cloud Director Container Service Extension (CSE) deployed Kubernetes cluster fails to VMware Cloud Director Object Storage Extension (OSE) S3 storage.
  • Attempting to activate the backup protection for a Kubernetes cluster fails in the OSE plugin in the VMware Cloud Director (VCD) Tenant portal.

Environment

  • VMware Cloud Director 10.6.1.x
  • VMware Cloud Director Object Storage Extension 3.1.0.x
  • VMware Cloud Director Container Service Extension 4.2.x

Cause

This issue occurs if there is an issue with Velero installed on the Kubernetes cluster to be backed up and the 'velero' namespace already exists on the cluster.
When the Start Protection button is clicked in the OSE plugin, OSE will install Velero on the Kubernetes cluster and can encounter issues if Velero components already exist.

Resolution

To resolve the issue the Velero components can be uninstalled and then the backup protection can be started again to have OSE install Velero.

Example steps would be as follows:

  1. Connect to the Cloud Director Object Storage Extension (OSE) Server using SSH as root.
  2. Download the 'kubectl' command tool to the OSE server and place it in '/usr/local/bin/kubectl'.
    For more information on installing 'kubectl' see the Kubernetes documentation, Install and Set Up kubectl on Linux.
  3. Download the 'velero' command tool from 'https://github.com/vmware-tanzu/velero/releases/download/v1.10.3/velero-v1.10.3-linux-amd64.tar.gz' to the OSE server. For example:

    1. wget https://github.com/vmware-tanzu/velero/releases/download/v1.10.3/velero-v1.10.3-linux-amd64.tar.gz
    2. tar -xvzf velero-v1.10.3-linux-amd64.tar.gz
    3. cp velero-v1.10.3-linux-amd64/velero /usr/local/bin/velero
    4. chmod 755 /usr/local/bin/velero

  4. Download the 'kubeconfig' of the target Kubernetes cluster to the OSE server, for example 'kubeconfig-example.conf'.
    The 'kubeconfig' file can be downloaded from the Cloud Director UI under Kubernetes Container Clusters > select the Kubernetes cluster > Download Kube Config.
  5. Export the 'kubeconfig' file:

    export KUBECONFIG=kubeconfig-example.conf


  6. Run the command 'kubectl get ns' to confirm that the 'velero' namespace already exists:

    kubectl get ns

  7. If the namespace 'velero' exists, then run the command 'velero uninstall':

    velero uninstall

  8. Once the uninstallation is completed, run 'kubectl get ns' again to confirm the namespace 'velero' has been removed and Velero is removed from the target Kubernetes cluster:

    kubectl get ns

  9. To reinstall Velero and backup the Kubernetes cluster, click Kubernetes Protection  > select the Kubernetes cluster > Start Protection in the OSE plugin and configure the backup as desired.
    OSE will automatically install Velero and create the 'velero' namespace with its components in the Kubernetes cluster.

Additional Information

For more information on backing up Kubernetes clusters in OSE, see the documentation Backing up and restoring Kubernetes clusters.