Openshift v3 space consumption check

4/4/2018

Can anyone tell me how do I check the current available volume, consumed space, on my Mongodb pod on the new Openshift Online Platform? After allocating around 4GB of space, I am unclear on what's the volume that has been consumed until now.

Any light thrown on this will help. Thank you.

-- Shreyas Gombi
containers
docker
kubernetes
mongodb
openshift

1 Answer

4/5/2018

You can run oc exec <mongodb_pod> -- df -H .

For example, I get the following output when I run it for the sample python app in my cluster:

$ oc exec os-sample-python-1-hrbq7 -- df -H

Filesystem                                                                                       Size  Used Avail Use% Mounted on
/dev/mapper/docker-253:1-94278-dbe79cf53785ab8a1b083f53c88088ab667a01f45e8a8725b26fbff82eef2a33   11G  689M   11G   7% /
tmpfs                                                                                            4.2G     0  4.2G   0% /dev
tmpfs                                                                                            4.2G     0  4.2G   0% /sys/fs/cgroup
/dev/vda1                                                                                         11G  3.0G  7.8G  28% /etc/hosts
shm                                                                                               68M     0   68M   0% /dev/shm
tmpfs                                                                                            4.2G   17k  4.2G   1% /run/secrets/kubernetes.io/serviceaccount
tmpfs                                                                                            4.2G     0  4.2G   0% /proc/scsi
-- CoolBeans
Source: StackOverflow