Kubernetes Storage Concepts: Difference between revisions
Line 41: | Line 41: | ||
The persistent volume subsystem consists of the following three API resource types that allow applications to consume storage: [[#Persistent_Volume|persistent volumes]], [[#Persistent_Volume_Claim|persistent volume claims]] and [[#Storage_Class|storage classes]]: | The persistent volume subsystem consists of the following three API resource types that allow applications to consume storage: [[#Persistent_Volume|persistent volumes]], [[#Persistent_Volume_Claim|persistent volume claims]] and [[#Storage_Class|storage classes]]: | ||
==<span id='PersistentVolume'></span><span id='PV'></span>PersistentVolume (PV)== | ==<span id='PersistentVolume'></span><span id='PV'></span><span id='Persistent_Volume'></span>PersistentVolume (PV)== | ||
A single external storage volume can only be used by a single persistent volume. | A single external storage volume can only be used by a single persistent volume. | ||
==<span id='PersistentVolumeClaim'></span><span id='PVC'></span>PersistentVolumeClaim (PVC)== | ==<span id='PersistentVolumeClaim'></span><span id='PVC'></span><span id='Persistent_Volume_Claim'></span>PersistentVolumeClaim (PVC)== | ||
A persistent volume claim is similar to a ticket that authorizes a pod to use a certain persistent volume. | A persistent volume claim is similar to a ticket that authorizes a pod to use a certain persistent volume. | ||
==<span id='StorageClass'></span><span id='SC'></span>StorageClass (SC)== | ==<span id='StorageClass'></span><span id='SC'></span><span id='Storage_Class'></span>StorageClass (SC)== | ||
=Volume= | =Volume= |
Revision as of 04:50, 10 December 2019
Internal
Overview
Kubernetes has a mature and feature-rich subsystem called the persistent volume subsystem. Regardless of where it comes from, storage is exposed to the Kubernetes cluster in the form of a volume.
Storage Providers
Storage is exposed to a Kubernetes cluster by storage providers.
The Kubernetes persistent volume subsystem supports, among others:
- iSCSI volumes
- SMB
- Enterprise storage arrays from vendors like EMC and NetApp
- NFS volumes
- object storage blobs
- Amazon Elastic Block Store block devices
- Azure File resources (AzureDisk).
- GCE Persistent Disks
Each storage provider has its own plugin that handles the details of exposing the storage to the Kubernetes cluster.
Storage Plugins
The terms "storage plugin" and "provisioner" are used interchangeably. "Provisioner" is used especially when dynamic provisioning is involved. "Driver" is a term that is also used here.
Old storage plugins used to be implemented as part of the main Kubernetes code tree (in-tree), which raised a series of problems, such as that all had to be open-source and their release cycle was tied to the Kubernetes release cycle.
Newer plugins are based on the Container Storage Interface (CSI) and can be developed out-of-tree.
Plugin Types
kuberentes.io/aws-ebs
Container Storage Interface (CSI)
Container Storage Interface (CSI) is an open standard that provides a clean interface for storage plugins and abstracts the internal Kubernetes storage details. CSI provides means so the external storage can be leveraged in a uniform way across multiple container orchestrators (not only Kubernetes).
API Resources
The persistent volume subsystem consists of the following three API resource types that allow applications to consume storage: persistent volumes, persistent volume claims and storage classes:
PersistentVolume (PV)
A single external storage volume can only be used by a single persistent volume.
PersistentVolumeClaim (PVC)
A persistent volume claim is similar to a ticket that authorizes a pod to use a certain persistent volume.
StorageClass (SC)
Volume
Secrets may be exposed as files in dedicated volumes mounted in the pod.
Volume Type
- hostPath
- configMap
Dynamic Volume Provisioning
Dynamic volume provisioner https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/