Skip to content

Volume

Medium — good to knowCI/CD & DevOps

ELI5 — The Vibe Check

A Volume is persistent storage attached to a container — because containers themselves are like tents: when you take them down, everything inside is gone. A volume is a storage drive you plug into the tent. When the tent comes down and goes back up, the data in the drive is still there.

Real Talk

A volume is a persistent storage mechanism for containers that exists independently of the container lifecycle. In Docker, volumes are managed by the Docker daemon. In Kubernetes, PersistentVolumes (PV) and PersistentVolumeClaims (PVC) provide an abstraction over the underlying storage (EBS, NFS, etc.).

Show Me The Code

# Docker volume mount
docker run -v my-volume:/data my-app

# Kubernetes PVC
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: db-storage
spec:
  accessModes: [ReadWriteOnce]
  resources:
    requests:
      storage: 10Gi

When You'll Hear This

"Mount a volume to persist the database between container restarts." / "The pod lost data because we didn't attach a volume."

Made with passive-aggressive love by manoga.digital. Powered by Claude.