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


相关推荐

  • shell 文件 数字比较

    shell 文件 数字比较

    2022年3月11日
    34
  • DialogResult的使用方法

    DialogResult的使用方法usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;namespace_2014

    2022年6月22日
    39
  • linux更改密码策略_hpunix设置用户密码策略

    linux更改密码策略_hpunix设置用户密码策略如何设置 Linux 系统的密码策略

    2022年4月22日
    219
  • Mysql数据库备份策略

    Mysql数据库备份策略Mysql数据库备份策略我的petstore所用的数据库是Mysql。Mysql的数据库备份不象那些企业界数据库那样完善,分为完全备份、差分备份以及日记纪录等等。Mysql备份数据库两个主要方法是用mysqldump程序或直接拷贝数据库文件。mysqldump与MySQL服务器协同操作。直接拷贝方法在服务器外部进行,并且你必须采取措施保证没有客户正在修改你将拷贝的表。如果你想用文件系统备份来备份数

    2022年5月2日
    43
  • 第58章、拍照功能实现(从零开始学Android)

    第58章、拍照功能实现(从零开始学Android)Android有两种拍照方法,一种是直接调用系统的照相Intent,使用onActivityResult获取图片资源或者指定图片路径,拍照返回成功后去指定路径读取图片;一种是用SurfaceView自定义界面,添加业务个性化功能。一、第一种方法1、设计界面  (1)、布局文件  打开activity_main.xml文件。  输入以下代码: 

    2022年6月18日
    26
  • sql 聚合函数对 null 的处理[通俗易懂]

    sql 聚合函数对 null 的处理[通俗易懂]聚合函数计数类型(count)SELECTCOUNT(*)FROM(SELECT1ASnumUNIONALLSELECT1ASnumUNIONALLSELECT2ASnumUNIONALLSELECTNULLASnum);SELECTCO

    2022年6月21日
    50

发表回复

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

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