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


相关推荐

  • F1 score,micro F1score,macro F1score 的定义

    F1 score,micro F1score,macro F1score 的定义本篇博客可能会继续更新最近在文献中经常看到precesion,recall,常常忘记了他们的定义,在加上今天又看到评价多标签分类任务性能的度量方法microF1score和macroF2score。决定再把F1score一并加进来把定义写清楚,忘记了再来看看。F1scoreF1score(以下简称F1)是用来评价二元分类器的度量,它的计算方法如下:F1&amp;ThickSpace;…

    2022年10月14日
    4
  • 开发微信公众号步骤_微信公众平台开发

    开发微信公众号步骤_微信公众平台开发磨刀不误砍柴工微信公众号大家肯定都用过。目前微信公众号主要分为订阅号和服务号,每种账号又分为未认证和已认证,它们的差别主要在于具有不同的接口权限,下图(引用自微信开发实战系列)是一些例子:不同类型公众号的权限总体来说,服务号权限>订阅号权限,认证账号权限>未认证账号权限。申请订阅号比较简单,服务号相对复杂点,另外要认证的话还要额外提交一些材料。我们可以根据不同的业务需求去申请不同类型的账号,基本上常用的权限列表已经可以满足大部分的场景。开发微信公众号本质上和通常.

    2022年9月28日
    4
  • 12306可以设置抢票吗_抢票软件哪个成功率高

    12306可以设置抢票吗_抢票软件哪个成功率高#-*-coding:utf-8-*-importrequestsimportreimportbase64fromcodesimportappimportjsonimporturllib.parseimporttimeimportdatetimesession=requests.Session()headers={‘User-Agent’:’Moz…

    2025年12月12日
    3
  • 知识网之C++总结

    知识网之C++总结

    2022年1月21日
    42
  • Dubbo监控中心(Monitor)的介绍和简易监控中心的安装

    Dubbo监控中心(Monitor)的介绍和简易监控中心的安装

    2022年3月7日
    51
  • pycharm激活码2021【2021最新】[通俗易懂]

    (pycharm激活码2021)好多小伙伴总是说激活码老是失效,太麻烦,关注/收藏全栈君太难教程,2021永久激活的方法等着你。IntelliJ2021最新激活注册码,破解教程可免费永久激活,亲测有效,下面是详细链接哦~https://javaforall.net/100143.html9ZHRNTE33T-eyJsaWNlbnNlSW…

    2022年3月28日
    75

发表回复

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

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