deployment -> pods 생성했다면.
pods 먼저 삭제하면 다시 실행되기 때문에..
deployment -> pods 순서대로 삭제해야 한다.
[~] kubectl get deployments
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
phantom-server 1 1 1 1 51m
[~] kubectl get pods
NAME READY STATUS RESTARTS AGE
phantom-server-649c56b6b7-nkmjd 1/1 Running 0 18m
[~] kubectl get pods
NAME READY STATUS RESTARTS AGE
phantom-server-649c56b6b7-wgtdl 1/1 Running 0 1m
[~]
[~]
[~]
[~] kubectl get pods
NAME READY STATUS RESTARTS AGE
phantom-server-649c56b6b7-mtxn8 1/1 Running 0 28m
[~] kubectl delete pods phantom-server-649c56b6b7-mtxn8
pod "phantom-server-649c56b6b7-mtxn8" deleted
[~] kubectl get pods
NAME READY STATUS RESTARTS AGE
phantom-server-649c56b6b7-mtxn8 1/1 Terminating 0 28m
phantom-server-649c56b6b7-wgtdl 1/1 Running 0 21s
->
[~] kubectl delete deployment phantom-server
deployment.extensions "phantom-server" deleted
[~] kubectl delete pods phantom-server-649c56b6b7-nkmjd
pod "phantom-server-649c56b6b7-nkmjd" deleted
마찬가지로
cronjob -> job -> pods 로 생성된다면
먼저 cronjob을 생성하고 차례대로 job, pods를 삭제해야 제대로 삭제된다.
하지만, namespace를 삭제하면 namespace 밑의 모든 service, ingress, nodeport, pods가 삭제되니 참고..