Repository navigation
Closed
Labels
area/storageIssues or PRs related to storage (linstor, seaweedfs, bucket, velero, harbor)Issues or PRs related to storage (linstor, seaweedfs, bucket, velero, harbor)kind/bugCategorizes issue or PR as related to a bugCategorizes issue or PR as related to a bugpriority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next releaseMust be staffed and worked on either currently, or very soon, ideally in time for the next release
Description
Describe the bug
After deleting a Harbor app CR, the jobservice PVC and cert-manager ACME http-solver resources remain in the namespace.
Environment
- Cozystack version: v1.4.0-rc.2
- Provider: on-prem (bare-metal)
To Reproduce
- Create a tenant with
seaweedfs: true, deployHarbor/test. - Wait until Ready.
- Delete the Harbor CR; wait ~120s.
kubectl -n <ns> get pvc,ingress | grep -E 'jobservice|cm-acme'— both remain.
Expected behaviour
No orphaned PVC / ACME solver resources remain after the app CR is deleted.
Actual behaviour
pvc/harbor-test-jobservice Bound
ingress/cm-acme-http-solver-xxxxx
pod/cm-acme-http-solver-xxxxx
service/cm-acme-http-solver-xxxxx
Additional context
- Root cause (PVC):
packages/apps/harbor/templates/harbor.yaml:102setspersistence.resourcePolicy: "keep", which annotates Harbor PVCs withhelm.sh/resource-policy: keep— so Helm/Flux deliberately never deletes them on uninstall. No cleanup hook overrides this. - Root cause (ACME): Harbor renders its own Ingress (
templates/ingress.yaml:21-26). It has a$wildcardSecretguard (skips ACME in wildcard mode), but in non-wildcard (http01) mode it setscluster-issuer→ same orphaned-stuck-challenge mechanism as the Bucket issue. - Proposed fix (two parts):
- PVC: add a
post-deletePVC cleanup hook (packages/apps/harbor/templates/hooks/cleanup-pvc.yaml, modeled on MariaDB), selectingapp.kubernetes.io/instance={{ .Release.Name }}. A hook is required precisely becauseresourcePolicy: keepblocks normal reclaim. (If retaining data on delete is intentional, that is a product decision — otherwise the hook closes the leak.) - ACME: same as the Bucket issue.
- PVC: add a
Found during a create→delete leak sweep of all 22 apps on Cozystack v1.4.0-rc.2.
Reacted by dosubot
Metadata
Metadata
Assignees
Labels
area/storageIssues or PRs related to storage (linstor, seaweedfs, bucket, velero, harbor)Issues or PRs related to storage (linstor, seaweedfs, bucket, velero, harbor)kind/bugCategorizes issue or PR as related to a bugCategorizes issue or PR as related to a bugpriority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next releaseMust be staffed and worked on either currently, or very soon, ideally in time for the next release
Activity
fix(harbor): clean up orphaned jobservice PVC and ACME solver resourc…
fix(harbor): clean up orphaned jobservice PVC and ACME solver resourc…
fix(harbor): clean up orphaned jobservice PVC and ACME solver resourc…