I am trying to delete PVC in kubernetes dashboard,I already delete all ElasticSearch service & pods in Kubernetes cluster,the PVC is not protected,this is my pod status:
~/Library/Mobile Documents/com~apple~CloudDocs/Document/k8s/work/elasticsearch ⌚ 11:25:38
$ kubectl describe pvc elasticsearch-data-quickstart-es-default-0
Name: elasticsearch-data-quickstart-es-default-0
Namespace: dabai-fat
StorageClass:
Status: Terminating (lasts 18m)
Volume: pv001
Labels: common.k8s.elastic.co/type=elasticsearch
elasticsearch.k8s.elastic.co/cluster-name=quickstart
elasticsearch.k8s.elastic.co/statefulset-name=quickstart-es-default
Annotations: pv.kubernetes.io/bind-completed: yes
pv.kubernetes.io/bound-by-controller: yes
Finalizers: [foregroundDeletion]
Capacity: 2Gi
Access Modes: RWO,ROX,RWX
VolumeMode: Filesystem
Mounted By: <none>
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal FailedBinding 50m (x42 over 60m) persistentvolume-controller no persistent volumes available for this claim and no storage class is set
how to delete this PVC?
First try to delete the pvc normally,
$ kubectl delete pvc <pvc-name> -n <namespace>
If it doesn't work, try to delete the pvc
by removing the finalizers.
$ kubectl patch pvc <pvc-name> -n <namespace> -p '{"metadata":{"finalizers":null}}'
$ kubectl delete pvc <pvc-name> -n <namespace>
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments