Skip to main content

k8s 강제로 pod 종료시키는 방법

k8s기반에서 강제로 pod 종료

  1. 죽지않는 pod 정보
    [root@control1 ~]# kubectl get  pod test-68d6bf4d95-zhx55 -n test_user
    NAME                       READY   STATUS        RESTARTS   AGE
    test-68d6bf4d95-zhx55   1/4     Terminating   0          68d
  2. 강제로 pod 삭제 
    [root@control1 ~]# kubectl delete  pod test-68d6bf4d95-zhx55 -n test_user -grace-period=0 -force
    warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
    pod "test-68d6bf4d95-zhx55" force deleted
  3. pod 정보 없는거 확인
    [root@control1 ~]# kubectl get  pod test-68d6bf4d95-zhx55 -n test_user
    Error from server (NotFound): pods "test-68d6bf4d95-zhx55" not found