---
type: archive
area: archive
status: archived
date: 2026-05-03
created: 2026-05-03
updated: 1980-01-01
tags:
  - archive
---
- When restarting a pod the data stored in the pod is deleted 
- To persist data in pods It need to be stored outside of the container in a volume
- The lifecycle of a volume is tied to the lifecycle of the entire pod and is
independent of the lifecycle of the container in which it is mounted. Due to this fact, volumes are also used to persist data across container restarts.
- To a pod can write in a volume it should be writable
- Before you mount a volume in a container to preserve files across container
restarts, consider how this affects the container’s self-healing capability.
+ A pod can contain multiple volumes and a container can mount multiple volumes
+ A volume can be shared or mounted in more than one container
![[img-20240913-013025-92718f77.png]]
In this figure we see that a volume may reference to external storage that make it persist even if the pod is deleted
![[img-20240913-013715-d9e8a056.png]]
- Volume Types
1. emptyDir
2. hostPath
3. nfs
4. gcePersistentDisk,  awsElasticBlockStore, azureFile, azureDisk
5. cephfs, cinder, fc, flexVolume, flocker, glusterfs, iscsi,
6. portworxVolume, quobyte , rbd, scaleIO, storageos,
7. photonPersistentDisk, vsphereVolume
8. configMap, secret, downwardAPI
9. persistentVolumeClaim
10. csi
In pods with two or more containers, an emptyDir volume is used to
share data between them.
![[img-20240913-024756-b0a31944.png]]
An emptyDir volume is a dedicated directory created specifically for and
used exclusively by the pod in which the volume is defined
You can’t mount the same GCE Persistent Disk on multiple hosts simultaneously in read/write mode.You can only mount it on multiple hosts if you use the read-only mode.
