欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

k8s 删除pod 一直卡在 pod 处于Terminating 销毁状态

程序员文章站 2024-03-09 15:47:23
...
[[email protected] ~]# kubectl get pod -A
NAMESPACE       NAME                                        READY   STATUS             RESTARTS   AGE
ingress-nginx   ingress-nginx-admission-create-nmx6s        0/1     Completed          0          10h
ingress-nginx   ingress-nginx-admission-patch-n5wcd         0/1     Completed          0          10h
ingress-nginx   ingress-nginx-controller-56dc588c6b-vhwsp   0/1     ImagePullBackOff   0          10h
kube-system     coredns-7f89b7bc75-9gjrx                    1/1     Running            1          12h
kube-system     coredns-7f89b7bc75-bkj2k                    1/1     Running            1          12h
kube-system     etcd-node1                                  0/1     Terminating        34         10h
kube-system     kube-apiserver-node1                        0/1     CrashLoopBackOff   35         10h
kube-system     kube-controller-manager-node1               1/1     Running            1          12h
kube-system     kube-flannel-ds-amd64-2z8rw                 1/1     Running            1          12h
kube-system     kube-flannel-ds-amd64-4pmhj                 1/1     Running            1          12h
kube-system     kube-flannel-ds-amd64-vqwwk                 1/1     Running            1          12h
kube-system     kube-proxy-562gr                            1/1     Running            2          12h
kube-system     kube-proxy-6q6p9                            1/1     Running            1          12h
kube-system     kube-proxy-t5bkd                            1/1     Running            1          12h
kube-system     kube-scheduler-node1                        1/1     Running            1          12h
[[email protected] ~]# kubectl delete pod/etcd-node1 -n kube-system
pod "etcd-node1" deleted



^C
[[email protected] ~]# kubectl delete pod/etcd-node1  --force --grace-period=0 -n kube-system
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 "etcd-node1" force deleted
[[email protected] ~]# kubectl delete pod/etcd-node1  --force --grace-period=0 -n kube-system
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.
Error from server (NotFound): pods "etcd-node1" not found
[[email protected] ~]# kubectl delete pod/etcd-node1  
Error from server (NotFound): pods "etcd-node1" not found
[[email protected] ~]# kubectl get pod -A
NAMESPACE       NAME                                        READY   STATUS             RESTARTS   AGE
ingress-nginx   ingress-nginx-admission-create-nmx6s        0/1     Completed          0          10h
ingress-nginx   ingress-nginx-admission-patch-n5wcd         0/1     Completed          0          10h
ingress-nginx   ingress-nginx-controller-56dc588c6b-vhwsp   0/1     ImagePullBackOff   0          10h
kube-system     coredns-7f89b7bc75-9gjrx                    1/1     Running            1          12h
kube-system     coredns-7f89b7bc75-bkj2k                    1/1     Running            1          12h
kube-system     kube-apiserver-node1                        0/1     Terminating        35         10h
kube-system     kube-controller-manager-node1               1/1     Running            1          12h
kube-system     kube-flannel-ds-amd64-2z8rw                 1/1     Running            1          12h
kube-system     kube-flannel-ds-amd64-4pmhj                 1/1     Running            1          12h
kube-system     kube-flannel-ds-amd64-vqwwk                 1/1     Running            1          12h
kube-system     kube-proxy-562gr                            1/1     Running            2          12h
kube-system     kube-proxy-6q6p9                            1/1     Running            1          12h
kube-system     kube-proxy-t5bkd                            1/1     Running            1          12h
kube-system     kube-scheduler-node1                        1/1     Running            1          12h
[[email protected] ~]# kubectl delete pod/kube-apiserver-node1 --force --grace-period=0 -n kube-system
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 "kube-apiserver-node1" force deleted

强制删除 

[[email protected] ~]# kubectl delete pod/etcd-node1  --force --grace-period=0 -n kube-system
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.
Error from server (NotFound): pods "etcd-node1" not found

相关标签: k8s篇