Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: kubectl karmada deinit doesn't cascade deletion of pvc resources #4750

Open
CharlesQQ opened this issue Mar 26, 2024 · 5 comments · May be fixed by #4759
Open

fix: kubectl karmada deinit doesn't cascade deletion of pvc resources #4750

CharlesQQ opened this issue Mar 26, 2024 · 5 comments · May be fixed by #4759
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@CharlesQQ
Copy link
Contributor

CharlesQQ commented Mar 26, 2024

What happened:

  1. Create karmada control plane as as the following command:
    kubectl-karmada init --kube-image-registry=registry.cn-hangzhou.aliyuncs.com/google_containers --storage-classes-name=local-path --etcd-pvc-size='30Gi' --etcd-storage-mode='PVC' --wait-component-ready-timeout=360 --etcd-replicas 3 --karmada-apiserver-replicas 3
  2. pod and pvc created successfully
    image
  3. remove karmada control plane as the following command:
    kubectl karmada deinit
  4. pod deleted but pvc not
    image

What you expected to happen:

pvc should be cascade deleted when etcd pods deleted. Otherwise, etcd pods can't be ready when created again.
pvc might be add ownerReferences field, field item is etcd sts.

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • Karmada version: karmada 1.9
  • kubectl-karmada or karmadactl version (the result of kubectl-karmada version or karmadactl version):
  • Others:
@CharlesQQ CharlesQQ added the kind/bug Categorizes issue or PR as related to a bug. label Mar 26, 2024
@CharlesQQ
Copy link
Contributor Author

After k8s 1.27, support statefulset-pvc-auto-deletion, refer to (https://kubernetes.io/blog/2023/05/04/kubernetes-1-27-statefulset-pvc-auto-deletion-beta/); but earlier version use must delete pvc manually.

@CharlesQQ
Copy link
Contributor Author

CharlesQQ commented Mar 27, 2024

I have a idea, Introduced flag --etcd-sts-pvc-delete-policy=Delete to set field
sts.spec.persistentVolumeClaimRetentionPolicy.whenDeleted value

image

@XiShanYongYe-Chang
Copy link
Member

I have a idea, Introduced flag --etcd-sts-pvc-delete-policy=Delete to set field sts.spec.persistentVolumeClaimRetentionPolicy.whenDeleted value

I agree with this idea, would you like to submit a PR? The flag name can be discussed in the PR

@CharlesQQ
Copy link
Contributor Author

I agree with this idea, would you like to submit a PR? The flag name can be discussed in the PR

sure!

@XiShanYongYe-Chang
Copy link
Member

In favor of #4759
/assign @CharlesQQ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants