园子的找找看搜索服务 zzk-api 部署在专门的节点 zzk-node 上,今天突然出现 pod 无法调度部署的问题,对于的 pod 部署 events
Warning FailedScheduling 3m38s default-scheduler 0/14 nodes are available: 1 node(s) had untolerated taint {node.kubernetes.io/disk-pressure: }, 2 node(s) were unschedulable, 3 node(s) had untolerated taint {node-role.kubernetes.io/control-plane: }, 8 node(s) didn't match Pod's node affinity/selector. preemption: 0/14 nodes are available: 14 Preemption is not helpful for scheduling
请求如何解决这个问题?
扩容磁盘空间后解决了,从 Avail: 48G, Use%:90%
扩容至 Avail: 58G, Use%: 89%
奇怪的是,还有10%的可用空间,k8s 为什么就以 disk-pressure
为由不肯调度
通过官方文档 Hard eviction thresholds 知道了,原来默认值就是 10%
The kubelet has the following default hard eviction thresholds:
nodefs.available<10%
在 /etc/default/kubelet
配置文件中可以看到 hard eviction thresholds 的配置
KUBELET_EXTRA_ARGS="--kube-reserved=cpu=300m,memory=300Mi,ephemeral-storage=1Gi --system-reserved=cpu=200m,memory=200Mi,ephemeral-storage=1Gi --eviction-hard=memory.available<500Mi,nodefs.available<10%"
可以直接修改这个配置文件,比如我们这里修改为 5%
KUBELET_EXTRA_ARGS="--kube-reserved=cpu=300m,memory=300Mi,ephemeral-storage=1Gi --system-reserved=cpu=200m,memory=200Mi,ephemeral-storage=1Gi --eviction-hard=memory.available<500Mi,nodefs.available<5%"
重启 kubelet 使修改生效
systemctl restart kubelet
或者通过 KubeletConfiguration
清单文件中的 evictionHard
设置修改