强制删除pod报:Immediate deletion does not wait for confirmation that the running resource...

kubectl delete pod kube-flannel-ds-amd64-hj9qr -n kube-system --force --grace-period=0 发现无法强制删除

[root@kmaster ~]# kubectl delete pod kube-flannel-ds-amd64-hj9qr -n kube-system --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.
pod "kube-flannel-ds-amd64-hj9qr" force deleted
[root@kmaster ~]# kubectl get pod -n kube-system
NAME                              READY   STATUS     RESTARTS   AGE
coredns-bccdc95cf-4r9rj           0/1     Pending    0          39m
coredns-bccdc95cf-lq5kr           0/1     Pending    0          39m
etcd-kmaster                      1/1     Running    2          77m
kube-apiserver-kmaster            1/1     Running    2          77m
kube-controller-manager-kmaster   1/1     Running    2          77m
kube-flannel-ds-amd64-bq62b       0/1     Init:0/1   0          7s
kube-proxy-n58tv                  1/1     Running    2          77m
kube-scheduler-kmaster            1/1     Running    2          76m

查看kube-flannel-ds-amd64-hj9qr属于那种pod的类型

kubectl describe pod -n kube-system kube-flannel-ds-amd64-pwhvw

强制删除pod报:Immediate deletion does not wait for confirmation that the running resource..._第1张图片

查看kubectl get daemonset -n kube-system

[root@kmaster ~]# kubectl get daemonset -n kube-system
NAME                      DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR                     AGE
kube-flannel-ds-amd64     1         1         0       1            0           beta.kubernetes.io/arch=amd64     27m
kube-flannel-ds-arm       0         0         0       0            0           beta.kubernetes.io/arch=arm       10m
kube-flannel-ds-arm64     0         0         0       0            0           beta.kubernetes.io/arch=arm64     10m
kube-flannel-ds-ppc64le   0         0         0       0            0           beta.kubernetes.io/arch=ppc64le   10m
kube-flannel-ds-s390x     0         0         0       0            0           beta.kubernetes.io/arch=s390x     10m
kube-proxy                1         1         1       1            1           beta.kubernetes.io/os=linux       83m

在namespaces之前或之后加上它所属的name

变换后的形式为:kubectl delete daemonset name -n kube-system --force --grace-period=0

kubectl delete daemonset kube-flannel-ds-amd64 -n kube-system --force --grace-period=0

再次查看成功删除

[root@kmaster ~]# kubectl delete daemonset kube-flannel-ds-amd64 -n kube-system --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.
daemonset.extensions "kube-flannel-ds-amd64" force deleted
[root@kmaster ~]# kubectl get daemonset -n kube-system
NAME                      DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR                     AGE
kube-flannel-ds-arm       0         0         0       0            0           beta.kubernetes.io/arch=arm       12m
kube-flannel-ds-arm64     0         0         0       0            0           beta.kubernetes.io/arch=arm64     12m
kube-flannel-ds-ppc64le   0         0         0       0            0           beta.kubernetes.io/arch=ppc64le   12m
kube-flannel-ds-s390x     0         0         0       0            0           beta.kubernetes.io/arch=s390x     12m
kube-proxy                1         1         1       1            1           beta.kubernetes.io/os=linux       84m

 

你可能感兴趣的:(k8s)