Currently, there is no resolution and a possible fix in the product will be targeted for a future release.
However, you can check out the workaround to get your use case in a working state and at the same time, have the kapp controller continue to manage the extension so reconciliation is successful each time the extension(s) are reconciled in the cluster.
Workaround:
You will see the erroneous state in the cluster from the
Cause section of this article. And you want to get to the following
correct state to get the Harbor extension deployed successfully with an existing PVC:
Correct state- name: registry-data
persistentVolumeClaim:
claimName: <claim-name>In order to achieve the correct state, you can execute the following instructions:
- Delete the Harbor App
- kubectl delete -f harbor-extension.yaml
- kubectl delete app harbor -n tanzu-system-registry
- Do not delete harbor-data-values secret, namespace, existing PVC, and/or roles created as part of the installation.
- Once the application is deleted, update your harbor-extension.yaml file to reflect the following changes:
# harbor k14s objects managed by kapp-controller
---
apiVersion: kappctrl.k14s.io/v1alpha1
kind: App
metadata:
name: harbor
namespace: tanzu-system-registry
annotations:
tmc.cloud.vmware.com/managed: "false"
spec:
syncPeriod: 5m
serviceAccountName: harbor-extension-sa
fetch:
- image:
url: projects.registry.vmware.com/tkg/tkg-extensions-templates:v1.3.1_vmware.1
template:
- ytt:
ignoreUnknownComments: true
paths:
- tkg-extensions/common
- tkg-extensions/registry/harbor
inline:
paths:
update-registry-pvc.yaml: |
#@ load("@ytt:overlay", "overlay")
#@overlay/match by=overlay.subset({"kind": "Deployment", "metadata": {"name": "harbor-registry"}})
---
spec:
template:
spec:
volumes:
#@overlay/match by="name"
#@overlay/replace
- name: registry-data
persistentVolumeClaim:
claimName: "<UPDATE_CLAIM_NAME_HERE>"
pathsFrom:
- secretRef:
name: harbor-data-values
deploy:
- kapp:
rawOptions: ["--wait-timeout=5m"]
- Once the changes are updated, apply the harbor-extension.yaml file to the cluster to deploy the harbor extension
- kubectl apply -f harbor-extension.yaml
- Verify/Validate the status of the app
- kubectl -n tanzu-system-registry get app harbor
- kubectl -n tanzu-system-registry describe app harbor