볼륨을 삭제(delete pvc) 커맨드를 실행하더라도 종료되지 않는다.
$ kubectl get pod -w
NAME READY STATUS RESTARTS AGE
consul-0 1/1 Running 0 28d
consul-1 1/1 Running 0 28d
consul-2 1/1 Running 0 28d
consul-3 1/1 Running 0 28d
consul-4 1/1 Running 0 28d
pv를 확인한다.
$ kubectl get pv
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
pvc-46e015f0-3041-11e9-a0e7-fa163ecffc2b 1Gi RWO Delete Bound default/datadir-consul-3 standard 26d
pvc-535563b9-3041-11e9-a0e7-fa163ecffc2b 1Gi RWO Delete Bound default/datadir-consul-4 standard 26d
pvc-b07a2c23-303d-11e9-a0e7-fa163ecffc2b 1Gi RWO Delete Bound default/datadir-consul-0 standard 26d
pvc-c32c35d9-303d-11e9-a0e7-fa163ecffc2b 1Gi RWO Delete Bound default/datadir-consul-1 standard 26d
pvc-d420797e-303d-11e9-a0e7-fa163ecffc2b 1Gi RWO Delete Bound default/datadir-consul-2 standard 26
$ kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
consul-0 Bound pvc-b07a2c23-303d-11e9-a0e7-fa163ecffc2b 1Gi RWO standard 26d
consul-1 Bound pvc-c32c35d9-303d-11e9-a0e7-fa163ecffc2b 1Gi RWO standard 26d
consul-2 Bound pvc-d420797e-303d-11e9-a0e7-fa163ecffc2b 1Gi RWO standard 26d
consul-3 Bound pvc-46e015f0-3041-11e9-a0e7-fa163ecffc2b 1Gi RWO standard 26d
consul-4 Bound pvc-535563b9-3041-11e9-a0e7-fa163ecffc2b 1Gi RWO standard 26d
$ kubectl delete pvc consul-0 consul-1 consul-2 consul-3 consul-4
persistentvolumeclaim "consul-0" deleted
persistentvolumeclaim "consul-1" deleted
persistentvolumeclaim "consul-2" deleted
persistentvolumeclaim "consul-3" deleted
persistentvolumeclaim "consul-4" deleted
$ kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
consul-0 Terminating pvc-b07a2c23-303d-11e9-a0e7-fa163ecffc2b 1Gi RWO standard 28d
consul-1 Terminating pvc-c32c35d9-303d-11e9-a0e7-fa163ecffc2b 1Gi RWO standard 28d
consul-2 Terminating pvc-d420797e-303d-11e9-a0e7-fa163ecffc2b 1Gi RWO standard 28d
consul-3 Terminating pvc-46e015f0-3041-11e9-a0e7-fa163ecffc2b 1Gi RWO standard 28d
consul-4 Terminating pvc-535563b9-3041-11e9-a0e7-fa163ecffc2b 1Gi RWO standard 28d
volume이 지워지지 않는다. 계속 Terminating 상태이다.
statefulset을 삭제하자 마자 모두 삭제된다.
$ kubectl delete statefulsets consul
statefulset.apps "consul" deleted
$ kubectl get pod
No resources found.
$ kubectl get pvc
No resources found.
$ kubectl get pv
No resources found.