Error: ytt: Map item (key podAnnotations) Expected number of matched nodes to be 1, but was 0 during Harbor Package Reconciliation
search cancel

Error: ytt: Map item (key podAnnotations) Expected number of matched nodes to be 1, but was 0 during Harbor Package Reconciliation

book

Article ID: 448836

calendar_today

Updated On:

Products

VMware vSphere Kubernetes Service

Issue/Introduction

Harbor PackageInstall (pkgi) fails to reconcile in Tanzu Kubernetes Grid (TKG) environments following a cluster upgrade. The reconciliation status remains in ReconcileFailed with a ytt overlay error specifically referencing podAnnotations.

Symptoms:

  • kubectl get pkgi -n tkg-system harbor shows status Reconcile failed.
  • kubectl describe pkgi harbor -n tkg-system displays the following error: ytt: Error: - library.eval: Evaluating library 'bundle/config': Overlaying data values... Document on line ?: Map item (key 'podAnnotations') on line ?: Expected number of matched nodes to be 1, but was 0
  • Issue typically occurs after upgrading the guest cluster (e.g., from v1.34.x to v1.35.x) or the Harbor package version.

Environment

Harbor Package 2.14.3+vmware.2-vks.1 or similar

Resolution

  1. Identify the configuration secrets used by the Harbor package: kubectl get pkgi harbor -n tkg-system -o yaml (Look for values.secretRef names, e.g., harbor-tkg-system-values).
  2. Export and back up the current secret values: kubectl get secret harbor-tkg-system-values -n tkg-system -o jsonpath='{.data.values\.yaml}' | base64 -d > harbor-values-backup.yaml
  3. Edit the secret or the values file to remove the podAnnotations and metrics blocks from the root level of the values.yaml content.
  4. Apply the updated values to the secret: kubectl create secret generic harbor-tkg-system-values -n tkg-system --from-file=values.yaml=harbor-values.yaml --dry-run=client -o yaml | kubectl apply -f -
  5. Pause and resume the package to trigger a fresh reconciliation: kubectl patch pkgi harbor -n tkg-system --type merge -p '{"spec":{"paused":true}}' kubectl patch pkgi harbor -n tkg-system --type merge -p '{"spec":{"paused":false}}'
  6. Verify the status: kubectl get pkgi harbor -n tkg-system