Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get list of files inside a running Kubernetes Pod's memory

Is it possible to get a list files which are occupying a running Pods memory? I have tried metrics-server but that just tells memory and CPU usage per pod and node. Much appreciate any help.

like image 254
Himanshu Kumar Avatar asked Sep 01 '25 10:09

Himanshu Kumar


1 Answers

By assuming what you looking is to list the files inside the container(s) in the pod, you can simply execute kubectl exec command,

List down the pods

kubectl get pods

Get the pod name.

List the filesystem contents,

kubectl exec -it <pod Name> ls

or even,

kubectl exec -it <pod Name> ls <desired path>
like image 153
Anuradha Fernando Avatar answered Sep 03 '25 01:09

Anuradha Fernando