VeleroService installation fails due to stale velero-service annotation on the Supervisor Service namespace
search cancel

VeleroService installation fails due to stale velero-service annotation on the Supervisor Service namespace

book

Article ID: 400179

calendar_today

Updated On:

Products

Tanzu Kubernetes Runtime

Issue/Introduction

If the velero plugin fails to install and we delete the vSphere namespace, the namespace is deleted successfully. But when the user creates a new namespace and attempts to install the plugin again, it fails with the error: 

    The expected annotation already exists, velero-service=<velero-service-name>

   This stale annotation exists on the Velero Supervisor Service namespace (svc-velero-domain-cXX).

   When the VeleroService is deleted, the annotation needs to be removed from the namespace.


# kubectl get veleroservice -n <velero service> -o yaml
apiVersion: v1
items:
- apiVersion: veleroappoperator.vmware.com/v1alpha1
  kind: VeleroService
  metadata:
   creationTimestamp: "202x-01-10T00:00:16Z"
    generation: 1
    name: default
   namespace: xxxx-velero-xxxx
    resourceVersion: "1027674"
   uid: ########-####-####-####-############
  spec:
    image: dockerhub.usw5.packages.broadcom.com/velero/velero:v1.13.0
   namespace: <velero-service-namespace>
    nodefaultbackuplocation: true
    nosecret: true
    objectstoreprovider: aws
    plugins:
    - dockerhub.usw5.packages.broadcom.com/vsphereveleroplugin/velero-plugin-for-vsphere:v1.5.3
    version: v1.13.0
  status:
    enabled: true
    installmessage: 'Failed to install Velero since there is existing Velero instance
     in the cluster. Error: The expected annotation already exists, velero-service=<velero-service-name>'
    installphase: Failed
kind: List
metadata:
  resourceVersion: ""

 

Cause

The installation failed due to vSphere namespace was deleted but not uninstalled.

Resolution

 It is a best practice uninstall velero service.

   velero-vsphere uninstall [flags]

Example:

   velero-vsphere uninstall -n velero

See: https://github.com/vmware-tanzu/velero-plugin-for-vsphere/blob/main/docs/velero-vsphere-operator-cli.md#uninstall-velero--plugins