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 byte数组拷贝_异或校验原理

    java byte数组拷贝_异或校验原理其实在以前没接触这些内容的时候,脸上是懵逼的表情,完全不明白异或是为了干什么。其实用简单的语言来说,接收数据的异或校验相当于解密,发送时候的校验位相当于加密;官方解释是:其他数据信息传递中为保证数据传递正确可靠,在数据帧中常加载异或校验位(个人理解怕传输过程中出现数据丢失损坏的情况,所以加校验保证了数据的准确性)言归正传java中怎么异或校验1、发送数据byte[]rece=newbyte[6];rece[0]=0x55;

    2022年9月28日
    2
  • 几种流行Webservice框架性能对照

    几种流行Webservice框架性能对照

    2021年12月7日
    49
  • Scripting.FileSystemObject控件的用法「建议收藏」

    Scripting.FileSystemObject控件的用法「建议收藏」文件系统对象FSO的英文全称是FileSystemObject,这种对象模型提出了有别于传统的文件操作语句处理文件和文件夹的方法。通过采用object.method这种在面向对象编程中广泛使用的语法,将一系列操作文件和文件夹的动作通过调用对象本身的属性直接实现。在jsp中,Scripting.FileSystemObject控件调用可以直接在js中使用这个控件varf

    2022年7月14日
    15
  • L2-014 列车调度 (25 分)详解

    L2-014 列车调度 (25 分)详解火车站的列车调度铁轨的结构如下图所示。两端分别是一条入口(Entrance)轨道和一条出口(Exit)轨道,它们之间有N条平行的轨道。每趟列车从入口可以选择任意一条轨道进入,最后从出口离开。在图中有9趟列车,在入口处按照{8,4,2,5,3,9,1,6,7}的顺序排队等待进入。如果要求它们必须按序号递减的顺序从出口离开,则至少需要多少条平行铁轨用于调度?输入格式:输入第一行给出一个整数N…

    2022年7月26日
    7
  • Swift编程语言的相关资料

    Swift编程语言的相关资料

    2021年11月29日
    39
  • 【AS】Windows10下Git环境变量配置

    很久没用回Windows了,最近因为工作原因又回归到Windows的怀抱,配置完AS的开发环境后使用Git管理本地代码时提示:’git’不是内部或外部命令,也不是可运行的程序或批处理文件。去百度大概搜了一下,是因为没有配置Git环境变量的原因,但是没有具体的解决步骤,特此记录一下.(PS:如何下载和安装就不具体赘述了,直接百度Git就能下载,安装教程请点击参考)一.确定G…

    2022年4月4日
    162

发表回复

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

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