k8s pod 状态 Evicted[通俗易懂]

k8s pod 状态 Evicted[通俗易懂]删除Evicted状态的pod[root@hadoop03kubernetes]#kubectlgetpods|grepEvicted|awk'{print$1}’|xargskubectldeletepodpod”glusterfs-2p28b”deleted[root@hadoop03kubernetes]#kubectldescribepodglusterfs-cpft7Name:glusterfs-cpft7N.

大家好,又见面了,我是你们的朋友全栈君。

在这里插入图片描述

删除 Evicted 状态的pod

[root@hadoop03 kubernetes]# kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod
pod "glusterfs-2p28b" deleted

[root@hadoop03 kubernetes]# kubectl describe pod glusterfs-cpft7
Name:           glusterfs-cpft7
Namespace:      default
Priority:       0
Node:           hadoop01/
Start Time:     Tue, 11 Jan 2022 16:32:20 +0800
Labels:         controller-revision-hash=74d67c47f7
                glusterfs-node=daemonset
                pod-template-generation=1
Annotations:    <none>
Status:         Failed
Reason:         Evicted
Message:        Pod The node had condition: [DiskPressure].
IP:
IPs:            <none>
Controlled By:  DaemonSet/glusterfs
Containers:
  glusterfs:
    Image:        hadoop03:5000/gluster-centos:gluster3u12_centos7
    Port:         <none>
    Host Port:    <none>
    Liveness:     exec [/bin/bash -c systemctl status glusterd.service] delay=60s timeout=3s period=10s #success=1 #failure=3
    Readiness:    exec [/bin/bash -c systemctl status glusterd.service] delay=60s timeout=3s period=10s #success=1 #failure=3
    Environment:  <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-ckvvw (ro)
Volumes:
  kube-api-access-ckvvw:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   BestEffort
Node-Selectors:              storagenode=glusterfs
Tolerations:                 node.kubernetes.io/disk-pressure:NoSchedule op=Exists
                             node.kubernetes.io/memory-pressure:NoSchedule op=Exists
                             node.kubernetes.io/network-unavailable:NoSchedule op=Exists
                             node.kubernetes.io/not-ready:NoExecute op=Exists
                             node.kubernetes.io/pid-pressure:NoSchedule op=Exists
                             node.kubernetes.io/unreachable:NoExecute op=Exists
                             node.kubernetes.io/unschedulable:NoSchedule op=Exists
Events:
  Type     Reason     Age    From               Message
  ----     ------     ----   ----               -------
  Normal   Scheduled  2m56s  default-scheduler  Successfully assigned default/glusterfs-cpft7 to hadoop01
  Warning  Evicted    2m56s  kubelet            The node had condition: [DiskPressure].
[root@hadoop03 kubernetes]#

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述
–eviction-hard=nodefs.available<10%

[root@hadoop03 kubernetes]# cat /usr/lib/systemd/system/kubelet.service.d/10-kubeadm.conf
# Note: This dropin only works with kubeadm and kubelet v1.11+
[Service]
Environment="KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --eviction-hard=nodefs.available<10%"
Environment="KUBELET_CONFIG_ARGS=--config=/var/lib/kubelet/config.yaml"
# This is a file that "kubeadm init" and "kubeadm join" generates at runtime, populating the KUBELET_KUBEADM_ARGS variable dynamically
EnvironmentFile=-/var/lib/kubelet/kubeadm-flags.env
# This is a file that the user can use for overrides of the kubelet args as a last resort. Preferably, the user should use
# the .NodeRegistration.KubeletExtraArgs object in the configuration files instead. KUBELET_EXTRA_ARGS should be sourced from this file.
EnvironmentFile=-/etc/sysconfig/kubelet
ExecStart=
ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS

在这里插入图片描述

原因:资源不足时导致的驱赶

参考:https://www.jianshu.com/p/29bebed74eda
https://www.cnblogs.com/ainimore/p/12757867.html

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/145433.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 不含重复字符的最长子串长度JAVA_字符串回文判断

    不含重复字符的最长子串长度JAVA_字符串回文判断给你一个二进制字符串 s ,现需要将其转化为一个 交替字符串 。请你计算并返回转化所需的 最小 字符交换次数,如果无法完成转化,返回 -1 。交替字符串 是指:相邻字符之间不存在相等情况的字符串。例如,字符串 “010” 和 “1010” 属于交替字符串,但 “0100” 不是。任意两个字符都可以进行交换,不必相邻 。示例 1:输入:s = “111000”输出:1解释:交换位置 1 和 4:”111000″ -> “101010” ,字符串变为交替字符串。示例 2:输入:s =

    2022年8月9日
    9
  • 移动端fastClick使用

    移动端fastClick使用作为一个新手,插件原理什么的研究不透,看的也是似懂非懂的,网上有很多大牛写的博文相当的好   在这里我只是简单的记录下简单的用法,还请大牛们不吝赐教     为什么存在延迟?     从点击屏幕上的元素到触发元素的 click 事件,移动浏览器会有大约300毫秒的等待时间。为什么这么设计呢?因为它想看看你是不是要进行双击(doubletap)操作。1、引入插件的jav…

    2022年6月19日
    44
  • PHP IDE phpstorm 常用快捷键

    PHP IDE phpstorm 常用快捷键

    2021年9月7日
    55
  • arcgis python实例_arcgis二次开发_arcgis二次开发python_arcgis二次开发实例

    arcgis python实例_arcgis二次开发_arcgis二次开发python_arcgis二次开发实例[1.rar]-QQ连连看的源码.单消秒杀挂机等功能喜欢的朋友请拿去研究[qqCHAR.rar]-qq验证码识别程序可以叫准确的识别出qq登陆前的验证码[1.rar]-本书以Visualc++作为开发语言,结合大量实例,详细介绍了利用Arcobjects组件进行GIS二次开发的方法和过程。书中在讲述利用Arcobjects实现GIS功能的基础上,重点介绍了在Arcobjects环境…

    2022年6月17日
    25
  • bs和cs架构的区别和优缺点_百年灵b1p1和b1x1区别

    bs和cs架构的区别和优缺点_百年灵b1p1和b1x1区别BS和CS架构的区别BS就是浏览器服务器架构(网站)CS就是需要安装的那些应用程序app二者比较:标准:BS开发更标准一些,因为CS需要在不同的系统上执行,BS只需要在浏览器上执行效率:CS效率更高,CS属于安装的软件,很多内容已经安装在电脑中了,只需要联网获取数据即可,而BS运行在浏览器上,所有的数据必须经过下载才能使用;升级:BS无缝升级,CS需要删除老版本,再安装新版本安全性:CS更为安全,因为必须安装软件才能使用;BS安全度较低,只要有浏览器就可以使用开发成本:CS开发成本更高

    2022年10月17日
    2
  • 异想天开 网商-男人商铺(六)

    异想天开 网商-男人商铺(六)

    2022年1月21日
    40

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号