CHK StatefulSets cannot change storage classes due to missing volume claims
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- go, kubernetes
- Domain
- databases, devops, infrastructure
Research direction
Start with the CHK StatefulSet and PVC reconciliation behavior, then compare it with the CHI behavior described in the reproduction. Reproduce the storageClassName change from ssd to ssd2, delete the PVC and pod, and trace why the PVC is not recreated. Done means CHK can recover with the updated storage class without the manual operator workaround.
Written by the indexing model from the issue text.
Description
CHK creates StatefulSets differently from CHI, making it very difficult to change storage classes. Unlike the ClickHouse (CHI) operator which allows for manual intervention through deletion of the PVC and POD, allowing the operator to reconcile, CHK STS store only the PVC name and not the full volume claim, which appears to lock the keeper pods on restart into a pending state.
CHK Reproduction
- Create CHK with storageClassName: ssd
- Update CHK to storageClassName: ssd2
- Delete PVC and pod to force recreation:
- Result: Pod stuck in Pending. PVC never recreated.
CHI Reproduction
- Create CHI with storageClassName: ssd
- Update CHI to storageClassName: ssd2
- Delete PVC and pod to force recreation:
- Result: Pod starts up and new PVC is created
Current CHK work around
- Delete the clickhouse-operator deployment
- Deploy the storage class update
- Locally, create new yaml files for all PVCs you will need to be replacing
- Delete the PVC of the pod you want to flip over
- Once the PVC is deleted (after the STS rolls the pod) create the new PVC from the local .yaml file (apply -f $FILE in kubectl)
- Repeat steps 4-6 for all other pods
- Redeploy the operator, which should do nothing
Ideally we'd like some way to configure the operator to recreate the PVC when a storage class is updated, but at the very least it would be good to have similar behaviour to CHI which allows for easier intervention.
- Dominant language
- Go
- Stars
- 2.6k
- Forks
- 577
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 4
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Altinity/clickhouse-operator
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Altinity/clickhouse-operator#2093 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
Altinity/clickhouse-operator#2094 ·
Maintainers usually reply within 2 days
-
[Regression / Discussion] Loss of hot-reloaded password rotation after removal of k8s_secret_* in 0.27.4Possibly taken @sunsingerus claimed this 3 days ago. Openplanned for review
Difficulty 5/5 Over a week Newbie friendliness 38/100
Altinity/clickhouse-operator#2092 · 1 comment · 1 assignee ·
Maintainers usually reply within 2 days
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Altinity/clickhouse-operator#2089 ·
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
Altinity/clickhouse-operator#2064 · 3 comments ·
Maintainers usually reply within 2 days
All issues in Altinity/clickhouse-operator
Similar issues
-
proxy logs "no user in context" at error level for every data gateway downloadPossibly taken @paul43210 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
txn2/mcp-data-platform#2063 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100
kubernetes-sigs/kueue#16990 ·
Maintainers usually reply within 1 day
-
enhancement exporter/awss3 needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
open-telemetry/opentelemetry-collector-contrib#51905 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
stellar/stellar-horizon#245 ·
Maintainers usually reply within 1 day