How to see the files in hostPath

8/23/2020

How I can see the files in kuberntes hostPath , I mean:

 hostPath:
      # Ensure the file directory is created.
      path: /var/local/aaa    
      type: DirectoryOrCreate

How I can enter to aaa directory ?

-- user3740179
kubernetes

2 Answers

8/23/2020

The hostPath is path on your machine. if you want to have look onto the files or directories then go to the path on machine so in your case it would be /var/local/aaa.

For more reference have a look on this https://kubernetes.io/docs/concepts/storage/volumes/#hostpath

-- Dashrath Mundkar
Source: StackOverflow

8/23/2020

A hostPath volume mounts a file or directory from the node's filesystem into the Pod. So you can login/ssh to the node where the pod is scheduled to run and check the files in /var/local/aaa path.

-- Arghya Sadhu
Source: StackOverflow