Kubernetes 101 : The hostPath storage for containers
A hostPath Volume mounts a directory on the pod's filesystem so that its containers can have access to a storage space.
The "/home/albert" directory from the host is mounted on the "/hostpath_dir" mountpoint of the debian container.
The "path" specifies the directory/file that will be mounted on the container's mountpoint "/hostpath_dir".
The "type" could be - DirectoryOrCreate - which means that the directory will be created if it doesn't exist on the host, or - Directory - which means that the directory must be present on the host otherwise, we will get an error at the creation of the pod.
There are other types like - File, Socket, CharDevice, BlockDevice, ... -
We could check our pod using the below command:
Comments