简体   繁体   English

Kubernetes Pod中的磁盘使用率

[英]Disk Usage in kubernetes pod

I am trying to debug the storage usage in my kubernetes pod. 我正在尝试调试kubernetes容器中的存储使用情况。 I have seen the pod is evicted because of Disk Pressure. 我已经看到由于磁盘压力而使盒被逐出。 When i login to running pod, the see the following 当我登录到运行的pod时,请参阅以下内容

Filesystem      Size  Used Avail Use% Mounted on
overlay          30G   21G  8.8G  70% /
tmpfs            64M     0   64M   0% /dev
tmpfs            14G     0   14G   0% /sys/fs/cgroup
/dev/sda1        30G   21G  8.8G  70% /etc/hosts
shm              64M     0   64M   0% /dev/shm
tmpfs            14G   12K   14G   1% /run/secrets/kubernetes.io/serviceaccount
tmpfs            14G     0   14G   0% /proc/acpi
tmpfs            14G     0   14G   0% /proc/scsi
tmpfs            14G     0   14G   0% /sys/firmware
root@deploy-9f45856c7-wx9hj:/# du -sh /
du: cannot access '/proc/1142/task/1142/fd/3': No such file or directory
du: cannot access '/proc/1142/task/1142/fdinfo/3': No such file or directory
du: cannot access '/proc/1142/fd/4': No such file or directory
du: cannot access '/proc/1142/fdinfo/4': No such file or directory
227M    /
root@deploy-9f45856c7-wx9hj:/# du -sh /tmp
11M /tmp
root@deploy-9f45856c7-wx9hj:/# du -sh /dev
0   /dev
root@deploy-9f45856c7-wx9hj:/# du -sh /sys
0   /sys
root@deploy-9f45856c7-wx9hj:/# du -sh /etc
1.5M    /etc
root@deploy-9f45856c7-wx9hj:/# 

As we can see 21G is consumed, but when i try to run du -sh it just returns 227M. 我们可以看到21G已被消耗,但是当我尝试运行du -sh它仅返回227M。 I would like to find out who(which directory) is consuming the space 我想找出谁(哪个目录)正在占用空间

According to the docs Node Conditions , DiskPressure has to do with conditions on the node causing kubelet to evict the pod. 根据“ 节点条件 ”文档, DiskPressure与节点上的条件有关,该条件导致kubelet逐出Pod。 It doesn't necessarily mean it's the pod that caused the conditions. 这并不一定意味着是造成这种情况的原因是豆荚。

DiskPressure DiskPressure

Available disk space and inodes on either the node's root filesystem or image filesystem has satisfied an eviction threshold 节点的根文件系统或映像文件系统上的可用磁盘空间和索引节点已满足收回阈值

You may want to investigate what's happening on the node instead. 您可能想调查节点上正在发生的事情。

Looks like the process 1142 is still running and holding file descriptors and/or perhaps some space (You may have other processes and other file descriptors too not being released) Is it the kubelet ?. 看起来进程1142仍在运行并保持文件描述符和/或可能有一些空间(您可能也没有释放其他进程和其他文件描述符)是kubelet吗? To alleviate the problem you can verify that it's running and then kill it: 要缓解该问题,您可以验证它是否正在运行,然后将其杀死:

$ ps -Af | grep 1142
$ kill -9 1142

PD You need to provide more information about the processes and what's running on that node. PD您需要提供有关流程以及该节点上正在运行的内容的更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM