Skip to content

Kubernetes Storage Management Architecture

Posted on:September 3, 2023 at 08:04 AM

Table of contents

Open Table of contents

K8s storage types

How K8s workload consume storage resouces

Volume

Persistent Volume

PV + PVC (Statically provisioned PV)

Relationship: 1 to 1

Storage Class + PVC (Dynamically provisioned PV)

Untitled.png

For those storage type that can allocate/deallocate new disk spaces, Storage Class provide the ability to dynamically PV for each PVC as well.

For example, Azure Files supports to create File Shares. When a new PVC is bind to StorageClass, K8s then notifies StorageClass.provisioner to help create a PV and a Azure File Share that this PV use as the storage base.

https://kubernetes-csi.github.io/docs/external-provisioner.html

How K8s controller plane manage storage resources

Volume plugin

Volume is a virtual concept in K8S to describe storage resources available for workloads(Pods). When a pod consuming a volume, it doesn’t cares about how it is mounted onto the container file system. The procedure is achieved by k8s control plane, container runtime and volume plugin together.

Volume Plugin is the component which controls how disks are attached, unattached, mounted, unmounted onto Nodes.

Untitled.png

Third party storage: CSI volume plugin & CSI volume driver

Untitled.png

K8s natively supports several in-tree volume plugins to manage commonly used storage. But to decouple and support more 3rd party volume plugins, it provides a CSI volume plugin(in-three) that enable third party CSI volume drivers(out-of-tree) to be used in Kubernetes.

TermDefinition
Container Storage Interface (CSI)A specification attempting to establish an industry standard interface that Container Orchestration Systems (COs) can use to expose arbitrary storage systems to their containerized workloads.
in-treeCode that exists in the core Kubernetes repository.
out-of-treeCode that exists somewhere outside the core Kubernetes repository.
CSI Volume PluginA new, in-tree volume plugin that acts as an adapter and enables out-of-tree, third-party CSI volume drivers to be used in Kubernetes.
CSI Volume DriverAn out-of-tree CSI compatible implementation of a volume plugin that can be used in Kubernetes through the Kubernetes CSI Volume Plugin.

Details about CSI volume plugin design

Untitled.png

external containerized CSI volume driver

external provisioner mechanism

Dynamically create PV

todo

Network-attached Storage

https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/#create-a-persistentvolume

Untitled.png

Advanced: OpenEBS

References