Kubernetes Persistent Volumes
Contents
Persistent Volume
pv-definition.yaml
|
|
Access Modes
Access Mode | CLI | Description |
---|---|---|
ReadWriteOnce | RWO | The volume can be mounted as read-write by a single node |
ReadOnlyMany | ROX | The volume can be mounted read-only by many nodes |
ReadWriteMany | RWX | The volume can be mounted as read-write by many nodes |
Reclaim Policy
Reclaim Policy | Description |
---|---|
Retain | Manual reclamation |
Recycle | Basic scrub(rm -rf /thevolume/* ) |
Delete | Associated storage asset such as AWS EBS, GCE PD, Azure Disk, or OpenStack Cinder volume is deleted |
Commands
|
|
|
|
Persistent Volume Claim
Binding Rule
Rule | Description |
---|---|
Sufficient Capacity | PV Capacity |
Access Modes | ReadOnlyMany / ReadWriteOnce / ReadWriteMany |
Volume Modes | Filesystem / Block |
Storage Class | Class |
Selector | matchLabels |
pvc-definition.yaml
|
|
Commands
Create a PVC
|
|
PVC List
|
|
Delete PVC
|
|
PVC Mount to POD
Mount
This is a same way for ReplicaSet, Deployment in
template
section.
|
|
Storage Class
Static Provisioning
|
|
|
|
Dynamic Provisioning
Storage Class
Storage Class
Check official Storage Class
sc-definition.yaml
|
|
Provisioner | Parameter | Values |
---|---|---|
kubernetes.io/gce-pd | type | pd-standard / pd-ssd |
kubernetes.io/gce-pd | replication-type | none / regional_pd |
Storage Class to PVC
pvc-definition.yaml
|
|
PVC to POD
pod-definition.yaml
|
|
Storage Class Leveling
Silver Storage Class
|
|
Gold Storage Class
|
|
Platinum Storage Class
|
|
Storage Class Commands
|
|