Storage
Choose ephemeral, persistent and shared storage deliberately.
What you will be able to do
- Use emptyDir for scratch space.
- Use a PVC for durable storage.
- Use StatefulSets for stable identities.
- Back up state, not just YAML.
In plain English
Container filesystems disappear with the pod. PersistentVolumes and PersistentVolumeClaims give durable storage. StatefulSets give stable identities for databases, which is why they exist.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5GiYour turn
EasyRequest 5Gi
Write a PVC request for 5Gi with ReadWriteOnce access.
YAML · starter
resources: {}Check your understanding before moving on.
Knowledge checkQuestion 1
Which object gives a database pod a stable identity?
Select an answer to continue
Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.