zoukankan      html  css  js  c++  java
  • How to forcefully delete a daemonset or a pod in kubernetes cluster

    I have setup a kubernetes cluster which is working fine. I created deployment with type as daemonset which then created few pods and it worked fine. I made few changes so I deleted the daemonset using:

    kubectl delete daemonset <name> --namespace=clustech
    

    While few pods were getting deleted, few of the machine went offline and thus the pods running on them went on to say unknown status. I need to remove those pods or completely remove that previous daemonset but unable to do. I am using below commands to delete pods:

    kubectl delete pod PODNAME --grace-period=0 --force
    

    But this shows below error:

    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 "deployment-6sj54" not found

    How can I delete the pods.?


    Re-run the second command with namespace parameter will do your job.

    --grace-period=0 --force is the right command to delete such pods.


    实际示例:

    [root@compass-user-hd-master3]:~# kubectl delete daemonset logging-fluentd-fluentd-v1-0 -n kube-system
    error: timed out waiting for the condition
    
    
    [root@compass-user-hd-master3]:~# kubectl delete pod logging-fluentd-fluentd-v1-0-xtqdv -n kube-system --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 "logging-fluentd-fluentd-v1-0-xtqdv" deleted
    

      

     
  • 相关阅读:
    pycharm的各种设置,配置
    python中文件路径的问题
    Pycharm使用的一些问题!!!
    networkx如何将图写到邻接矩阵里?
    networkX如何读取存储图的二进制.dat文件
    再次理解线性回归与梯度下降
    Python DataFrame 如何删除原来的索引,重新建立索引
    NetworkX初相识
    haproxy + keepalived + mycat 高可用与负载均衡集群配置 centos7
    otter+canal
  • 原文地址:https://www.cnblogs.com/weifeng1463/p/9982030.html
Copyright © 2011-2022 走看看