相关疑难解决方法(0)

Kubernetes:无法删除PersistentVolumeClaim(pvc)

我通过调用创建了以下持久卷

kubectl create -f nameOfTheFileContainingTheFollowingContent.yaml

apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-monitoring-static-content
spec:
  capacity:
    storage: 100Mi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/some/path"

---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pv-monitoring-static-content-claim
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: ""
  resources:
    requests:
      storage: 100Mi
Run Code Online (Sandbox Code Playgroud)

在此之后我试图删除pvc.但这个命令卡住了.在打电话时kubectl describe pvc pv-monitoring-static-content-claim我得到以下结果

Name:          pv-monitoring-static-content-claim
Namespace:     default
StorageClass:
Status:        Terminating (lasts 5m)
Volume:        pv-monitoring-static-content
Labels:        <none>
Annotations:   pv.kubernetes.io/bind-completed=yes
               pv.kubernetes.io/bound-by-controller=yes
Finalizers:    [foregroundDeletion]
Capacity:      100Mi
Access Modes:  RWO
Events:        <none>
Run Code Online (Sandbox Code Playgroud)

并为 kubectl describe pv pv-monitoring-static-content

Name:            pv-monitoring-static-content
Labels:          <none> …
Run Code Online (Sandbox Code Playgroud)

kubernetes persistent-volumes persistent-volume-claims

34
推荐指数
8
解决办法
3万
查看次数