Kubernetes·Kubernetes from first pod to production app

Storage

Choose ephemeral, persistent and shared storage deliberately.

Intermediate 14 min read Lesson 7 of 300 Challenge included
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.

pvc.yamlYAML
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: data
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 5Gi
Your turn

Request 5Gi

Easy

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 in
Finished reading?

Lock in what you just learned.

Mark this lesson complete to save your place and move one step closer to the certificate.

Next: Scaling
Lesson 7 of 300 · 0% of course