无法删除pod的处理

 

1.查看当前的pod

[root@master soft]# kubectl get pods
NAME                                  READY   STATUS                  RESTARTS   AGE
my-release-minio-0                    0/1     Pending                 0          16h
my-release-minio-1                    0/1     Pending                 0          16h
my-release-minio-2                    0/1     Pending                 0          16h
my-release-minio-3                    0/1     Pending                 0          16h
my-release-pulsar-bookie-0            0/1     Pending                 0          16h
my-release-pulsar-bookie-1            0/1     Pending                 0          16h
my-release-pulsar-bookie-2            0/1     Pending                 0          16h
my-release-pulsar-bookie-init-7xxnk   0/1     Init:Unknown            0          16h
my-release-pulsar-bookie-init-c2pgm   0/1     Init:Unknown            0          15h
my-release-pulsar-bookie-init-mdgqh   0/1     Init:ImagePullBackOff   0          21m
my-release-pulsar-broker-0            0/1     Pending                 0          16h
my-release-pulsar-proxy-0             0/1     Pending                 0          16h
my-release-pulsar-pulsar-init-m2mm6   0/1     Init:0/2                2          16h
my-release-pulsar-recovery-0          0/1     Pending                 0          16h
my-release-pulsar-zookeeper-0         0/1     Pending                 0          16h

 

2.尝试删除某个pod

[root@master soft]# kubectl delete pods my-release-minio-0 --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 "my-release-minio-0" force deleted

再次查看是没有删除的

[root@master soft]# kubectl get pods
NAME                                  READY   STATUS                  RESTARTS   AGE
my-release-minio-0                    0/1     Pending                 0          24s
my-release-minio-1                    0/1     Pending                 0          16h
my-release-minio-2                    0/1     Pending                 0          16h
my-release-minio-3                    0/1     Pending                 0          16h
my-release-pulsar-bookie-0            0/1     Pending                 0          16h
my-release-pulsar-bookie-1            0/1     Pending                 0          16h
my-release-pulsar-bookie-2            0/1     Pending                 0          16h
my-release-pulsar-bookie-init-7xxnk   0/1     Init:Unknown            0          16h
my-release-pulsar-bookie-init-c2pgm   0/1     Init:Unknown            0          15h
my-release-pulsar-bookie-init-mdgqh   0/1     Init:ImagePullBackOff   0          23m
my-release-pulsar-broker-0            0/1     Pending                 0          16h
my-release-pulsar-proxy-0             0/1     Pending                 0          16h
my-release-pulsar-pulsar-init-m2mm6   0/1     Init:0/2                2          16h
my-release-pulsar-recovery-0          0/1     Pending                 0          16h
my-release-pulsar-zookeeper-0         0/1     Pending                 0          16h

 

3.查看describe

kubectl describe pod my-release-minio-0
找到如下项目:
Controlled By: StatefulSet/my-release-minio

 

若是job类型的,则用如下方式删除

Controlled By:    Job/my-release-pulsar-bookie-init


[root@master soft]# kubectl get Job
NAME                            COMPLETIONS   DURATION   AGE
my-release-pulsar-bookie-init   0/1           16h        16h
my-release-pulsar-pulsar-init   0/1           16h        16h

kubectl delete job my-release-pulsar-pulsar-init --force --grace-period=0

 

 

 

 

4.查看StatefulSet

[root@master soft]# kubectl get StatefulSet
NAME                          READY   AGE
my-release-minio              0/4     16h
my-release-pulsar-bookie      0/3     16h
my-release-pulsar-broker      0/1     16h
my-release-pulsar-proxy       0/1     16h
my-release-pulsar-recovery    0/1     16h
my-release-pulsar-zookeeper   0/3     16h

 

5.删除StatefulSet

[root@master soft]# kubectl delete StatefulSet my-release-minio --force --grace-period=0
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.
statefulset.apps "my-release-minio" force deleted

 

6.再次查看

[root@master soft]# kubectl get pods
NAME                                  READY   STATUS              RESTARTS   AGE
my-release-pulsar-bookie-0            0/1     Pending             0          16h
my-release-pulsar-bookie-1            0/1     Pending             0          16h
my-release-pulsar-bookie-2            0/1     Pending             0          16h
my-release-pulsar-bookie-init-7xxnk   0/1     Init:Unknown        0          16h
my-release-pulsar-bookie-init-c2pgm   0/1     Init:Unknown        0          15h
my-release-pulsar-bookie-init-mdgqh   0/1     Init:ErrImagePull   0          26m
my-release-pulsar-broker-0            0/1     Pending             0          16h
my-release-pulsar-proxy-0             0/1     Pending             0          16h
my-release-pulsar-pulsar-init-m2mm6   0/1     Init:0/2            2          16h
my-release-pulsar-recovery-0          0/1     Pending             0          16h
my-release-pulsar-zookeeper-0         0/1     Pending             0          16h

说明已经删除了.

 

posted @ 2024-11-21 09:21  slnngk  阅读(2)  评论(0编辑  收藏  举报