vmware-tanzu / velero-plugin-for-vsphere

Plugin to support Velero on vSphere
Other
59 stars 49 forks source link

Old backuprepositories resources are not cleared after re-installation of Velero with plugin for vSphere #438

Open danfengliu opened 2 years ago

danfengliu commented 2 years ago

Describe the bug

Old backuprepositories resources are not cleared after reinstallation of Velero, as you can see the logs below, there're a lot of OLD backuprepositories, even though I uninstalled and installed Velero a lot times, right after vsphere-plugin installation, we can get old resource and error logs(from some previous Velero installation credential problem) in backup driver pod (these errors is about HTTP 403, but current backup location credential has no 403 issue, it's from some previous installation of Velero, it should not be report in my new installation).


╰─ k get backuprepositories -A
NAME                                      AGE
br-0912757a-92bb-4af4-ae8f-ae552d05183b
br-47d920bc-35af-4cde-950d-8fcc3af4ddbc   2d13h
br-490b1fc8-24d2-4093-be8d-40fea1fa9d55   2d12h
br-4fd1f1ad-086c-4632-b7cf-40133e1ecb39   5h27m
br-696c3d88-d419-4ca9-bfad-34afbcb91ff0   109m
br-6d6a5400-da65-458e-90db-6d78cce0c14e   5h4m
br-7afa843d-8bad-4937-a964-398b7dac0dba   90m
br-9f027fec-f965-4919-b732-9eb25eccaf20   28h
br-ad505655-92e2-4a03-9fe5-56c55571119d   127m
br-add34456-64a7-4706-9acf-8a845abc5b84   10h
br-cac0a0a6-dd23-40db-9237-18fcb4495e1f   31h
br-eaadcbe3-ad26-4208-a39c-2f0d2b0ce544   7h51m

k logs backup-driver-6d58db874d-6jbv6 -n velero

gSource="/go/pkg/mod/github.com/vmware-tanzu/astrolabe@v0.4.1-0.20210813185044-12eb18c3f6d5/pkg/pvc/pvc_protected_entity.go:280"
2022/01/07 09:09:03 pei = ivd:8d697404-985c-49ff-b8e7-adc398fd9291:3d62883e-585c-41a1-a866-23c67c4a4c26
time="2022-01-07T09:09:03Z" level=error msg="Failed to get the source snapshot PE for peID ivd:8d697404-985c-49ff-b8e7-adc398fd9291:3d62883e-585c-41a1-a866-23c67c4a4c26" error="GetObject failed for bucket test-bucket-01, key plugins/vsphere-astrolabe-repo/ivd/peinfo/ivd:8d697404-985c-49ff-b8e7-adc398fd9291:3d62883e-585c-41a1-a866-23c67c4a4c26: InvalidAccessKeyId: The AWS Access Key Id you provided does not exist in our records.\n\tstatus code: 403, request id: RRJ96T2B1PEPKWZV, host id: aW8FuVJ+89UzSHgR/pMj6YIa7s8d1yP0pKPeLlz5vKStl3PyEE1aEHizbkTCRfz3b39physqG+E=" error.file="/go/pkg/mod/github.com/vmware-tanzu/astrolabe@v0.4.1-0.20210813185044-12eb18c3f6d5/pkg/s3repository/repository_protected_entity_type_manager.go:176" error.function="github.com/vmware-tanzu/astrolabe/pkg/s3repository.(*ProtectedEntityTypeManager).GetProtectedEntity" logSource="/go/pkg/mod/github.com/vmware-tanzu/astrolabe@v0.4.1-0.20210813185044-12eb18c3f6d5/pkg/pvc/pvc_protected_entity_type_manager

To Reproduce

[Steps to reproduce the behavior]

Expected behavior

[A clear and concise description of what you expected to happen]

Troubleshooting Information

[Please refer to the Troubleshooting page and collect the required information]

Screenshots

[If applicable, add screenshots to help explain your problem.]

Anything else you would like to add:

[Miscellaneous information that will assist in solving the issue]

qiuming-best commented 2 years ago

I find some other crd also is not been deleted after uninstalling velero crd: snapshots.backupdriver.cnsdp.vmware.com, clonefromsnapshots.backupdriver.cnsdp.vmware.com

lintongj commented 2 years ago

Did you run commands under https://github.com/vmware-tanzu/velero-plugin-for-vsphere/blob/main/docs/vanilla.md#uninstall when uninstall velero?

qiuming-best commented 2 years ago

Did you run commands under https://github.com/vmware-tanzu/velero-plugin-for-vsphere/blob/main/docs/vanilla.md#uninstall when uninstall velero?

Thanks, I will try with the docs

ywk253100 commented 2 years ago

Velero tries to remove all CRDs with label "component": "velero" here, so the CRDs can be removed automatically with velero if the label is added into the CRDs created by the vSphere plugin when uninstalling velero.