Storage, topic 24 of 61
Volumes
A container's own filesystem is lost when it restarts. A volume is storage declared on the Pod and mounted into its containers. Some last as long as the Pod: emptyDir for scratch space shared between containers, configMap and secret for files. Others point at storage that outlives it, through a PersistentVolumeClaim.
A hostPath volume mounts a directory of the node, which ties the Pod to that node and is a security risk: keep it for system agents.
On Opsfolk
Nothing of ours for this topic yet: an article is on its way.
Elsewhere
- VolumesOfficial