Altinity / Altinity/clickhouse-operator

Changing reclaimPolicy on existing volumeClaimTemplate from Retain to Delete has no effect

Open
#1,711 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
2.6k
Forks
574
Avg merge
8d 6h
Merged PRs (30d)
6

Description

In my ClickHouseInstallation I have the following

  defaults:
    storageManagement:
      reclaimPolicy: Retain
      provisioner: Operator

  templates:
    volumeClaimTemplates:
      - name: data-1-volume
        provisioner: Operator
        spec:
          storageClassName: clickhouse-data-v1
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: 100Gi

If I add reclaimPolicy: Delete

  templates:
    volumeClaimTemplates:
      - name: data-1-volume
        provisioner: Operator
        reclaimPolicy: Delete
        spec:
          storageClassName: clickhouse-data-v1
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: 100Gi

The operator seems to process it successfully (and the CHI status goes to InProgress and then Completed); however, the underlying/relevant PV's reclaimPolicy is never updated (and remains as Retain)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the ClickHouseInstallation YAML shown and inspect the relevant PersistentVolume's reclaimPolicy before and after changing the volumeClaimTemplate. Trace the operator path that processes volumeClaimTemplates and verify the change is reflected on the underlying PV, with a regression test covering Retain-to-Delete updates.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.