OpenShift Volume Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 19: Line 19:


==Persistent Volume Claim==
==Persistent Volume Claim==
A ''persistent volume claim'' is a request for a persistence resource with specific attributes, such as storage size. Persistent volume claims are matched to available [[#Persistent_Volume|volumes]] and ''binds'' the pod to the volume. This process allows a claim to be used as a volume in a pod: OpenShift finds the volume backing the claim and mounts it into the pod. Persistent volume claims are project-specific objects.
The pod can be disassociated from the persistent volume by deleting the persistent volume claim. The persistent volume transitions from a "Bound" to "Released" state. To make the persistent volume "Available" again, edit it and remove the persistent volume claim reference, as shown [[OpenShift_PersistentVolume_Operations#Unbind_a_Pod_from_the_Volume|here]]. Transitioning the persistent volume from "Released" to "Available" state does not clear the storage content - this will have to be done manually.
{{Internal|OpenShift_Persistent_Volume_Claim_Definition|Persistent Volume Claim Definition}}
All persistent volume claims for the current project can be listed with:
[[OpenShift_PersistentVolume_Operations#List_Existent_Persistent_Volume_Claims_for_the_Current_Project|oc get pvc]]
{{Internal|OpenShift_PersistentVolume_Operations#Persistent_Volume_Claim_Operations|Persistent Volume Claim Operations}}


==EmptyDir==
==EmptyDir==

Revision as of 01:26, 6 February 2018

Internal

The Volume Mechanism

Volumes are mounted filesystems available to pods and their containers. Volumes may be backed by a number of host-local or network attached storage endpoints. The simplest volume type is EmptyDir, which is a temporary directory on a single machine. Administrators may also allow to request and attach Persistent Volumes.

Various contexts list the following objects as "volumes":

Volume Types

Persistent Volume Claim

A persistent volume claim is a request for a persistence resource with specific attributes, such as storage size. Persistent volume claims are matched to available volumes and binds the pod to the volume. This process allows a claim to be used as a volume in a pod: OpenShift finds the volume backing the claim and mounts it into the pod. Persistent volume claims are project-specific objects.

The pod can be disassociated from the persistent volume by deleting the persistent volume claim. The persistent volume transitions from a "Bound" to "Released" state. To make the persistent volume "Available" again, edit it and remove the persistent volume claim reference, as shown here. Transitioning the persistent volume from "Released" to "Available" state does not clear the storage content - this will have to be done manually.

Persistent Volume Claim Definition

All persistent volume claims for the current project can be listed with:

oc get pvc
Persistent Volume Claim Operations

EmptyDir

ConfigMap

Downward API

Host Path

Secret

NFS

Persistent Volume

https://docs.openshift.com/container-platform/latest/dev_guide/persistent_volumes.html
https://docs.openshift.com/container-platform/latest/architecture/additional_concepts/storage.html#persistent-volumes
https://docs.openshift.com/container-platform/latest/install_config/persistent_storage/index.html
Kubernetes Persistent Volume

Persistent volumes can be listed with oc get pv.

Persistent Volume Operations

Persistent Volume Definition

Persistent Volume Definition