[참고] Openshift 에서 PV 에 연결된 PVC 정보 확인 및 PV 삭제하기

리눅스/OpenShift|2023. 5. 11. 08:48
반응형

다음과 같이 출력되는 PV 를 삭제하려고 합니다.

# oc get pv
NAME         CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS        CLAIM                    STORAGECLASS   REASON   AGE
pv-example   1Gi        RWO            Retain           Terminating   project412/pvc-example   standard                17h

 

PV 를 삭제할때 아래와 같이 메세지 출력 후 한참동안 쉘 프롬프트가 출력되지 않는다면

# oc delete pv pv-example
persistentvolume "pv-example" deleted

 


^C[root@ocp ~]# 

 

연결된 PVC 정보를 확인해봐야 합니다.

# oc get pv pv-example -o jsonpath='{.spec.claimRef.name}' | xargs -n1 oc get pvc
NAME          STATUS   VOLUME       CAPACITY   ACCESS MODES   STORAGECLASS   AGE
pvc-example   Bound    pv-example   1Gi        RWO            standard       17h

 

연결된 PVC 가 확인되어 삭제를 선진행하고 PV 를 삭제하면 깔끔히 제거됩니다.

# oc delete pvc pvc-example
persistentvolumeclaim "pvc-example" deleted

 

# oc delete pv pv-example
persistentvolume "pv-example" deleted

 

반응형

댓글()