zoukankan      html  css  js  c++  java
  • kubernetes删除pod一直处于terminating状态的解决方法

    kubernetes删除pod一直处理 Terminating状态

    # kubectl get po -n mon
    NAME                                  READY   STATUS        RESTARTS   AGE
    alertmanager-d6ccb787b-4bvhx          1/1     Running       0          17h
    grafana-64855ff589-8ttkt              0/1     Terminating   0          17h
    grafana-677c547cf8-gd5d4              1/1     Running       0          17h
    kube-state-metrics-6d7449fc78-5rpmn   1/1     Running       0          19d
    node-exporter-5zs2r                   1/1     Running       0          17h
    node-exporter-wcct6                   1/1     Running       0          17h
    prometheus-b85bc99bd-8l6q2            1/1     Running       0          15h
    
    上述的grafana-64855ff589-8ttkt pod 已经处于Terminating状态 17个小时了,依旧没有删除掉
    

    这种情况下可以使用强制删除命令

    # kubectl delete pod grafana-64855ff589-8ttkt  --force --grace-period=0 -n mon
    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 "grafana-64855ff589-8ttkt" force deleted
    

    注意:必须加-n参数指明namespace,否则可能报错pod not found。

    查看

    kubectl get po -n mon
    NAME                                  READY   STATUS    RESTARTS   AGE
    alertmanager-d6ccb787b-4bvhx          1/1     Running   0          17h
    grafana-677c547cf8-gd5d4              1/1     Running   0          17h
    kube-state-metrics-6d7449fc78-5rpmn   1/1     Running   0          19d
    node-exporter-5zs2r                   1/1     Running   0          17h
    node-exporter-wcct6                   1/1     Running   0          17h
    prometheus-b85bc99bd-8l6q2            1/1     Running   0          16h
    

    强制删除完毕

  • 相关阅读:
    CMake 用法导览
    Irrlicht 1.8.4 + Win7 + VC2015 + x64 +OpenGL编译
    VirtualBox 5.1.14 获取VirtualBox COM对象错误
    CGAL Manual/tutorial_hello_world.html
    CGAL 介绍
    Open CASCADE 基础类(Foundation Classes)
    OpenCASCADE 基础
    Nginx 反向代理详解
    修改docker容器中的hosts文件
    Jmeter 设置连接oracle数据库
  • 原文地址:https://www.cnblogs.com/zisefeizhu/p/13807297.html
Copyright © 2011-2022 走看看