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

  

 

How to forcefully delete a daemonset or a pod in kubernetes cluster的更多相关文章

  1. Kubernetes组件-DaemonSet

    ⒈简介 Replicationcontroller和ReplicaSet都用于在Kubermetes集群上部署运行特定数量的pod.但是,当某些情况下我们希望在集群中的每个节点上运行同一个指定的pod ...

  2. DaemonSet和StatefulSet

    DaemonSet 的使用 通过该控制器的名称我们可以看出它的用法:Daemon,就是用来部署守护进程的,DaemonSet用于在每个Kubernetes节点中将守护进程的副本作为后台进程运行,说白了 ...

  3. Kubernetes学习笔记(二):部署托管的Pod -- 存活探针、ReplicationController、ReplicaSet、DaemonSet、Job、CronJob

    存活探针 Kubernetes可以通过存活探针(liveness probe)检查容器是否存活.如果探测失败,Kubernetes将定期执行探针并重新启动容器. 官方文档请见:https://kube ...

  4. k8s创建资源的两种方式及DaemonSet应用(5)

    一.创建方式分类 Kubernetes 支持两种方式创建资源: (1)用 kubectl 命令直接创建,比如: kubectl run httpd-app --image=reg.yunwei.com ...

  5. k8s daemonset controller源码分析

    daemonset controller分析 daemonset controller简介 daemonset controller是kube-controller-manager组件中众多控制器中的 ...

  6. Kubernetes的DaemonSet(下篇)

    用Daemon Pod来进行通信 使用Pod来再DaemonSet中通信的手段有: 推的方式:在DaemonSet中的Pod会被配置成发送更新到如状态数据库这样的服务.这些都没有客户端. IP+端口方 ...

  7. Kubernetes的DaemonSet(上篇)

    背景 静儿作为美团容器化团队HULK的一员,经常需要和Kubernetes(k8s)打交道.第一次登陆node(宿主机)的时候,发现连续登陆几台都看到了Prometheus-Node-Exporter ...

  8. Kubernetes学习之路(十三)之Pod控制器--DaemonSet

    一.什么是DaemonSet? DaemonSet 确保全部(或者一些)Node 上运行一个 Pod 的副本.当有 Node 加入集群时,也会为他们新增一个 Pod .当有 Node 从集群移除时,这 ...

  9. DaemonSet

    What is a DaemonSet? DaemonSet能够让所有(或者一些特定)的Node节点运行同一个pod.当节点加入到kubernetes集群中,pod会被(DaemonSet)调度到该节 ...

随机推荐

  1. POJ--2570--Fiber Network【floyd+位运算】

    题意:一些公司决定搭建一些光纤网络.单向的,假设从第一点到第二点,有ab两个公司能够搭建,第二点到第三点有ac两个公司能够搭建,第一点到第三点有d公司能够搭建,则第一点到第三点有a.d两个公司能够搭建 ...

  2. iOS获取网络类型的四种方法

    Reachability类只能区分WIFI和WWAN类型,却无法区分2G网和3G网. 网上也有些方法,却都存在Bug. 经过网上查找资料和测试,基本上总结了以下几种方法: 1.使用导航栏的方式:(私有 ...

  3. 启明星Exchange/outlook预定会议室终端显示解决方案

    启明星会议室预定系统(Exchange2007及其以上版本,)终端调用说明 (一)技术原理 系统采用三级刷新方式,以尽可能减少对服务器的访问压力. (1) exe程序,每隔5分钟访问Exchange, ...

  4. java web中servlet、jsp、html 互相访问的路径问题

    java web中servlet.jsp.html 互相访问的路径问题 在java web种经常出现 404找不到网页的错误,究其原因,一般是访问的路径不对. java web中的路径使用按我的分法可 ...

  5. 深入理解Java中的组合和继承

    Java是一个面向对象的语言.每一个学习过Java的人都知道,封装.继承.多态是面向对象的三个特征.每个人在刚刚学习继承的时候都会或多或少的有这样一个印象:继承可以帮助我实现类的复用.所以,很多开发人 ...

  6. longest-substring-with-at-least-k-repeating-characters

    https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters/ public class S ...

  7. Python并发编程-Redis

    Redis 简介 Redis 是完全开源免费的,遵守BSD协议,是一个高性能的key-value数据库. Remote Dictionary Server(Redis)是一个基于 key-value ...

  8. C#线程同步与死锁Monitor

    在上一讲介绍了使用lock来实现C#线程同步.实际上,这个lock是C#的一个障眼法,在C#编译器编译lock语句时,将其编译成了调用Monitor类.先看看下面的C#源代码: public stat ...

  9. Maximum Depth of Binary Tree leetcode java

    题目: Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the ...

  10. 深入理解VUE样式style层次分析

    刚开始使用vue的时候容易被里面的样式搞懵: 样式可以在main.js中引入,在模块js文件中引入,在组件中的style标签引入,在组件中的script标签引入,还可以在index.html的body ...