After performing a Velero restore of a Harbor CNF, the following symptoms are observed:
Log Evidence
W0304 ##### reflector.go:569] failed to list *v1.ConfigMap: configmaps is forbidden: User "#####" cannot list resource "configmaps" in API group "" at the cluster scopeE0304 ##### reflector.go:166] "Unhandled Error" err="Failed to watch *v1.Secret: secrets is forbidden: User \"#####\" cannot list resource \"secrets\" in API group \"\""
W0304 ##### reflector.go:561] failed to list apiextensions.k8s.io/v1, Kind=CustomResourceDefinition: customresourcedefinitions.apiextensions.k8s.io is forbidden: User "#####" cannot list resource "customresourcedefinitions" at the cluster scope
TCA 3.x
TCP 5.0
The issue is primarily caused by a Namespace Mismatch in the subjects section of the ClusterRoleBinding or RoleBinding objects following a Velero restore.
To resolve the issue, the RBAC bindings must be corrected to point to the original namespace where the pods are intended to run.
kubectl get clusterrolebinding -o json | jq -r '.items[] | select(.subjects[].namespace=="harbor-restored") | .metadata.name'kubectl patch clusterrolebinding ingress-ngi-95992-lurjn-ingress-nginx --type='json' -p='[{"op": "replace", "path": "/subjects/0/namespace", "value": "harbor"}]'kubectl patch clusterrolebinding metallb-014-95992-bxazy-controller --type='json' -p='[{"op": "replace", "path": "/subjects/0/namespace", "value": "harbor"}]'kubectl patch clusterrolebinding metallb-014-95992-bxazy-speaker --type='json' -p='[{"op": "replace", "path": "/subjects/0/namespace", "value": "harbor"}]'kubectl delete pod -n harbor -l app.kubernetes.io/name=ingress-nginxkubectl delete pod -n harbor -l app.kubernetes.io/name=metallbPost-Recovery Verification & Best Practices