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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • [代码与实例] 爬虫 爬ooxx图 嘿嘿

    [代码与实例] 爬虫 爬ooxx图 嘿嘿闲话不多说直接撸代码importurllib.requestimporturllib.errorimportosimportsysimporthttp.serverimporthttp.clientimporttimeimportreimportrandomimportmathdata=Noneheaders={‘User-Agent’:’Mozilla/5.0(WindowsNT6.1;WOW64)AppleWebKit/537.36(

    2025年8月10日
    5
  • c语言中按位异或的作用,C语言 按位异或实现加法(示例代码)

    c语言中按位异或的作用,C语言 按位异或实现加法(示例代码)/*C语言按位异或实现加法*/#include#include#includevoidtest1(){inta=2;intb=3;intcand=0;intcxor=0;intc=0;//实现c=a+b//1.不考虑进位,按位计算各位累加(用异或实现),得到值xor;cxor=a^b;/*实现说明:a的值是2,对应计算机中补码是0000000000000…

    2022年5月10日
    43
  • oracle导出建表sql_Oracle数据库语句汇总

    oracle导出建表sql_Oracle数据库语句汇总第一步:安装pl/sqlDeveloper(此程序Oracle必备软件,在此不再讨论)第二步:登录pl/sqlDeveloper                                           登录界面第三步在左侧菜单选择Tables第三步点开Tables后在要导出的表上右键-DBMS_MetaData-DDL即可导出创建表的DDL语句

    2025年9月8日
    4
  • [VB.NET]圖片透明化[通俗易懂]

    [VB.NET]圖片透明化[通俗易懂]原URL:http://www.dotblogs.com.tw/chou/archive/2009/02/12/7120.aspx有沒有辦法做到圖片的透明化,我們可以透過MakeTransparent達成MSDN:Bitmap.MakeTransparent方法:為這個Bitmap將預設的透明色彩變為透明。 而在此程式中,加上了讓使用者點選顏色的功能,並且讓點

    2022年7月21日
    26
  • 关于AssetBundle

    关于AssetBundle前阵子研究了一下Untiy的AssetBundle,把相关的一些知识点整理跟大家分享一下。1、什么是AssetBundleAssetBundle是Unitypro提供的一种用来存储资源的文件格式,它可以存储任意一种Unity引擎能够识别的资源,如Scene、Mesh、Material、Texture、Audio、noxss等等,同时,AssetBundle也可以包含开

    2022年6月29日
    39
  • maven镜像还有不支持发型版本5

    maven镜像还有不支持发型版本5maven镜像<mirror> <id> alimaven </id> <mirrorOf> central </mirrorOf> <name> aliyunmaven </name> <url> http://maven.aliyun.com/nexus/content/repositories/central/ </u

    2022年8月21日
    6

发表回复

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

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