如何确定kubernetes pod临时存储请求和限制? [英] How to determine kubernetes pod ephemeral storage request and limit?

查看:67
本文介绍了如何确定kubernetes pod临时存储请求和限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Pod中运行的服务输出了太多日志,并导致临时存储不足.结果,吊舱被逐出,其他服务无法部署到k8s.

My service running in a pod output too much log and cause low ephemeral storage. As a result, the pod is evicted and other services can't deploy to k8s.

那么,如何确定Pod资源临时存储请求和限制以避免这种情况?我找不到有关临时存储的最佳实践.

So how I can determine pod resource ephemeral storage requests and limit to avoid this situation? I can't find any best practice about ephemeral storage.

推荐答案

请注意,默认情况下,如果您未对 ephemeral-storage 设置任何限制,则pod可以访问整个磁盘.它正在运行的节点上,因此,如果您确定是因为该原因而导致容器被逐出,则可以确定该容器消耗了所有容器.您可以从kubelet日志中进行检查,因为kubelet是负责检测此行为并逐出容器的人.

Note that by default, if you have not set any limits on ephemeral-storage the pod has access to the entire disk of the node it is running on, so if you are certain that the pod is being evicted because of this, then you are certain that the pod consumed it all. You can check this from kubelet logs, as kubelet is the guy in charge of detecting this behavior and evicting the pod.

现在,您有两个选择.您可以设置一个 ephemeral-storage 限制,并进行受控的容器驱逐,或者只是获取一个外部卷,将其映射到容器中,然后将日志发送到该节点之外.

Now, here you have two options. Either you can set an ephemeral-storage limit, and make a controlled pod eviction, or just get an external volume, map it into the container, and get the logs outside of the node.

您还可以按照shubham_asati的建议监视磁盘使用情况,但是如果它全部吃光了,那就全部吃光了.您只是要看看它是如何填写的.

You can also monitor the disk usage, as suggesting shubham_asati, but if it is eating it all, it is eating it all. You are just going to look at how it is getting filled out.

这篇关于如何确定kubernetes pod临时存储请求和限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆