Declaring a volume under spec.volumes only makes it available to the Pod. Each container that needs it must also list it under its own volumeMounts, linking the volume's name to a mountPath inside the container. Two containers can mount the same volume at different paths, which is how they share files.
Free account
Keep reading for free
Create a free StudyToCert account to read the rest of this lesson: 6 more sections, 4 key terms, a real-world example, an exam tip and self-check questions. Every lesson, lab and practice test is free with an account.