k8s pod 状态 Evicted[通俗易懂]
2023-06-13 09:11:32 时间
大家好,又见面了,我是你们的朋友全栈君。
删除 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.cn/145433.html原文链接:https://javaforall.cn
相关文章
- k8s部署之kubesphere安装以及使用
- k8s系列(1)-腾讯云CVM手动部署K8S_Dashboard安装2
- k8s pod的状态为evicted
- K8S状态为evicted
- k8s 网络转发问题记录
- 关于 K8s中Kube-apiserver 的一些总结
- 微服务 - 搭建k8s(kubeadm)模拟复杂的生产环境(上篇)
- k8s实践(13)--有状态服务StatefulSet详解
- K8S 生态周报| Kubernetes Ingress-NGINX 功能冻结前最后一个版本发布
- 图解K8s源码 - k8s核心数据结构
- 如何在本地快速启动一个k8s集群?小技巧,学到了
- 【K8S 系列】k8s 学习二,kubernetes 核心概念及初步了解安装部署方式
- K8S 生态周报| Kubernetes 旧的 registry 将被冻结
- k8s 中发现很多为状态为 Evicted 的 Pod
- k8s网络模型
- K8s与Oracle的完美结合赋能企业数字化转型(k8s和oracle)