쿠버네티스에서
볼륨을 포함하는 statefulset이 종료되지 않으면, (사실 deployment도 영향 줄 수 있도)
볼륨을 삭제(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
Terminating 상태로 변경되었지만
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.
'Cloud' 카테고리의 다른 글
Kubernetes pod 재시작하기 (설정 없이) (0) | 2019.03.20 |
---|---|
kubernetes의 ip를 얻는 kubernetes 커맨드 (0) | 2019.03.19 |
NIFI-인증 (0) | 2019.03.14 |
[kubernetes] jenkins에서 github 저장소 접근하기 (0) | 2019.03.07 |
[kubernetes] custom resource definition 예시 (0) | 2018.12.18 |