1.容器被驱逐,首先比较直观的是查看Event
The node was low on resource: ephemeral-storage.
Container zk was using 910316Ki, which exceeds its request of 0.
2.原因
cat /etc/docker/daemon.json
{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m",
"max-file": "10"
},
"bip": "xxxxxx/24",
"oom-score-adjust": -1000,
"registry-mirrors": ["https://xxx.mirror.aliyuncs.com"],
"storage-driver": "overlay2",
"storage-opts":["overlay2.override_kernel_check=true"],
"live-restore": true
}
k8s容器应用使用console以方便日志采集,日志尽管有清理,但是ephemeral-storage是整体概念
达到驱逐限制,则bbq
3.像zk或者Kafka中间件核心的有状态的虽然方便运维且有HA,但是存在驱逐后有一定风险。
即使单独使用打标签、打污点的专属节点,但只是缓解风险来临,因此建议优先选择非k8s环境。