且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何确定kubernetes pod临时存储请求和限制?

更新时间:2023-01-09 08:23:58

请注意,默认情况下,如果您未对 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.