

Then, the relevant component in a cluster dynamically creates the volume snapshot and the corresponding VolumeSnapshotContent object. To create a volume snapshot, create a VolumeSnapshot object and specify the VolumeSnapshotClass object. The volume snapshot design follows the PVC and PV system design. Kubernetes uses a system of persistent volume claim (PVC) and persistent volume (PV) to simplify storage operations. Volume Snapshot User Interface - Snapshot Kubernetes provides a CSI Snapshot controller to create volume snapshots.

Snapshots also help to quickly complete data replication and migration operations, such as environment replication and data development. The storage service must create snapshots for online data and restore data quickly to improve the fault tolerance of data operations in volumes. Note that this provisioner does not support dynamic provisioning yet.By Huang Ke (nicknamed Zhitian), Senior R&D Engineer at Alibaba 1) Basics Background of Volume Snapshots The local volume static provisioner manages the PersistentVolume lifecycle for local disks by detecting and creating PVs for each local disk found on the host, and cleaning up the disks when released. To improve the local volume lifecycle management, Konvoy ships an external local volume static provisioner. To ensure the PVC binding decision also evaluates other node constraints the Pod may have, create a StorageClass with volumeBindingMode set to WaitForFirstConsumer. It enables the Kubernetes scheduler to correctly schedule Pods using local volumes to the correct node.įor more details on the options available to create a PersistentVolume, check Kubernetes PersistentVolume documentation. NodeAffinity is required when using local volumes. If the block device that backs the volume is empty, Kubernetes creates a filesystem on the device before mounting it for the first time.Ĭonfigure path with the directory this PersistentVolume refers to. A volume in Filesystem mode is mounted into Pods into a directory. Volume in Block mode is mounted into a Pod as a block device, without any filesystem on it. VolumeMode can be set to Block, instead of the default value Filesystem, to expose the local volume as a raw block device. NodeAffinity: # nodeAffinity is required when using local volumes. Path: /mnt/volume/disk1 # Path to the directory this PV refers to. VolumeMode: Filesystem # Mount volume into Pod as a directory. The following is an example of a PersistentVolume using a local volume and nodeAffinity: apiVersion: v1

Applications using local volumes must be able to tolerate this reduced availability, and potential data loss, depending on the durability characteristics of the underlying disk.Ĭurrently, local volumes can only be used as statically created PersistentVolumes because Dynamic provisioning for local storage is not yet supported in Kubernetes. If a node becomes unhealthy, then the local volume will also become inaccessible, and a Pod using it can not run. However, local volumes are subject to the availability of the node and are not suitable for all applications.
#What is kubernetes pvc portable#
This means local volumes can be used in a durable and portable manner without manually scheduling Pods to nodes. The system is aware of the volume’s node constraints by looking at the node affinity on the PersistentVolume. Local persistent volumes allows users to access local storage through the standard Kubernetes Persistent Volume Claim (PVC) interface in a simple and portable way. Local Storage VolumeĪ local volume represents a device such as a disk, partition or directory available on a node. This document describes what a local volume is and how you can use it in Kubernetes.
