简体   繁体   English

无法正确删除cStor卷副本

[英]Unable to delete cStor volume replica properly

I did ctrl-c terminate the kubectl delete -f openebs-operator.yml because it hangs definitely while the openebs is empty already. 我做了ctrl-c来终止kubectl delete -f openebs-operator.yml,因为当openebs已经为空时,它肯定会挂起。 didn't realize the background jobs are still running. 没有意识到后台作业仍在运行。

get this message in kube-apiserver log:
E0112 18:10:53.877564 999 crd_finalizer.go:275] cstorvolumereplicas.openebs.io failed with: timed out waiting for the condition

Looks like cstorvolumereplicas.openebs.io cannot be deleted successfully. 看起来cstorvolumereplicas.openebs.io无法成功删除。 It says delete successfully but still there 它说删除成功,但仍然存在

The proper way of graceful deletion on OpenEBS is mentioned in OpenEBS docs under uninstallation section. 在OpenEBS文档的“卸载”部分中提到了在OpenEBS上正常删除的正确方法。

The recommended steps are: 建议的步骤是:

Delete all the OpenEBS PVCs that were created. 删除所有已创建的OpenEBS PVC。 You can check the status of PVC using the following command 您可以使用以下命令检查PVC的状态

kubectl get pvc

There should not have any entries of OpenEBS PVC. 不应包含任何OpenEBS PVC条目。

Delete all the SPCs (In case of cStor storage engine) 删除所有SPC(对于cStor存储引擎)

kubectl get spc -n openebs

There should not have any entries of OpenEBS SPC. OpenEBS SPC不应包含任何条目。

Ensure that no volume or pool pods are pending in terminating state . 确保没有卷或池Pod在终止状态下处于挂起状态。 You can check the running status of Pods using the following command. 您可以使用以下命令检查Pods的运行状态。

kubectl get pods -n <openebs namespace>

Delete the OpenEBS namespace either via helm purge or kubectl delete ns openebs. 通过helm purge或kubectl delete ns openebs删除OpenEBS命名空间。

Uninstalling the OpenEBS doesn't automatically delete the CRDs that were created. 卸载OpenEBS不会自动删除创建的CRD。 If you would like to complete remove the CRDs and the associated objects, run the following commands: 如果要完成删除CRD和关联对象的操作,请运行以下命令:

kubectl delete crd castemplates.openebs.io
kubectl delete crd cstorpools.openebs.io
kubectl delete crd cstorvolumereplicas.openebs.io
kubectl delete crd cstorvolumes.openebs.io
kubectl delete crd runtasks.openebs.io
kubectl delete crd storagepoolclaims.openebs.io
kubectl delete crd storagepools.openebs.io
kubectl delete crd volumesnapshotdatas.volumesnapshot.external-storage.k8s.io
kubectl delete crd volumesnapshots.volumesnapshot.external-storage.k8s.io

As part of deleting the Jiva Volumes, OpenEBS launches scrub jobs for clearing the data from the nodes. 作为删除Jiva卷的一部分,OpenEBS启动清理作业,以清除节点中的数据。 The completed jobs need to be cleared using the following command. 需要使用以下命令清除已完成的作业。

kubectl delete jobs -l openebs.io/cas-type=jiva -n <namespace>

Sometimes, there are chances that cStor volumes will not get deleted. 有时,cStor卷可能不会被删除。 Below workaround will resolve this issue, perform following : 下面的解决方法将解决此问题,请执行以下操作:

kubectl edit cvr -n openebs

And then remove finalizers from the CVR Need to remove following entries 然后从CVR中删除终结器需要删除以下条目

finalizers:
- cstorvolumereplica.openebs.io/finalizer

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM