Skip to content

opensearch: data PVCs are left behind after the application is removed #4086

Description

@yankawai

Describe the bug

Removing an OpenSearch application leaves its data PVCs behind. The opensearch app chart has no cleanup hook (unlike clickhouse, kafka and harbor, which remove the operator-owned PVCs post-delete), and the OpenSearch operator's StatefulSet PVCs carry no ownerReference, so nothing removes them.

Environment

  • Cozystack v1.6.1 (platform 54); packages/apps/opensearch/templates/ on main contains no hooks
  • on-prem, Talos

To Reproduce

  1. Create an OpenSearch application in a tenant namespace, wait for the PVC to be bound.
  2. Remove the application.
  3. kubectl get pvc -l opster.io/opensearch-cluster=<release> in the tenant namespace.

Expected behaviour
Consistent with the other stateful app charts: the release's PVCs go away together with the application, or the retention is an explicit, documented choice.

Actual behaviour
The PVCs stay Bound indefinitely and keep counting against the tenant's storage quota. Observed after two test installs were removed on 2026-08-28:

data-opensearch-opensearch-test-nodes-0    Bound   10Gi   replicated   labels: opster.io/opensearch-cluster=opensearch-opensearch-test
data-opensearch-opensearch-test2-nodes-0   Bound   10Gi   replicated   labels: opster.io/opensearch-cluster=opensearch-opensearch-test2

No ownerReferences on either PVC; the HelmRelease and the OpenSearchCluster are gone.

A post-delete hook selecting opster.io/opensearch-cluster=<release> in the same shape as the clickhouse one would close this. Happy to send it if the maintainers prefer removal over retention here.

Activity

  1. added a commit that references this issue on Sep 18, 2026
    08a2e76
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage/needs-triageIndicates an issue needs triage by a maintainer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions