Repository navigation
clickhouse: keeper PVC is not deleted after the CR is removed #3057
Copy link
Copy link
Closed
Labels
area/databaseIssues or PRs related to managed databases (postgres, mariadb, redis, etcd, kafka, clickhouse)Issues or PRs related to managed databases (postgres, mariadb, redis, etcd, kafka, clickhouse)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 releasetriage/acceptedIndicates an issue is ready to be actively worked onIndicates an issue is ready to be actively worked on
Description
Describe the bug
After deleting a ClickHouse app CR, the ZooKeeper/keeper data PVC remains, consuming storage permanently.
Environment
- Cozystack version: v1.4.0-rc.2
- Provider: on-prem (bare-metal)
To Reproduce
- Create a tenant, deploy
ClickHouse/test. - Wait until Ready.
- Delete the ClickHouse CR; wait ~120s.
kubectl -n <ns> get pvc— the keeper PVC remains.
Expected behaviour
Data PVCs are released (or explicitly cleaned) after the CR is deleted.
Actual behaviour
pvc/default-chk-clickhouse-test-keeper-cluster1-0-0-0 Bound
Additional context
- Root cause: The keeper PVC backs a
ClickHouseKeeperInstallation(packages/apps/clickhouse/templates/chkeeper.yaml:65-72, volumeClaimTemplates), reconciled by the clickhouse-keeper-operator. The operator does not delete data PVCs when the CHK CR is removed (data-safety default), and the CRD exposes nopersistentVolumeClaimRetentionPolicyequivalent. (The main ClickHouse data PVCs have the same gap.) - Proposed fix: Add a
post-deletePVC cleanup hookpackages/apps/clickhouse/templates/hooks/cleanup-pvc.yaml, modeled on the MariaDB hook, selecting PVCs byapp={{ .Release.Name }}-keeper(chkeeper.yaml:42) andapp.kubernetes.io/instance={{ .Release.Name }}.
Found during a create→delete leak sweep of all 22 apps on Cozystack v1.4.0-rc.2.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/databaseIssues or PRs related to managed databases (postgres, mariadb, redis, etcd, kafka, clickhouse)Issues or PRs related to managed databases (postgres, mariadb, redis, etcd, kafka, clickhouse)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 releasetriage/acceptedIndicates an issue is ready to be actively worked onIndicates an issue is ready to be actively worked on
Activity
fix(clickhouse)!: clean up orphaned keeper and data PVCs on delete (#…
fix(clickhouse)!: clean up orphaned keeper and data PVCs on delete (#…
fix(clickhouse): surface cleanup hook failures and backfill legacy ke…
fix(clickhouse)!: clean up orphaned keeper and data PVCs on delete (#…
fix(clickhouse): surface cleanup hook failures and backfill legacy ke…
fix(clickhouse)!: clean up orphaned keeper and data PVCs on delete (#…
fix(clickhouse): surface cleanup hook failures and backfill legacy ke…
fix(clickhouse)!: clean up orphaned keeper and data PVCs on delete (#…