How to Use NAS Persistent Volumes Dynamically in a Kubernetes Cluster

By Kan Junbao

1. Introduction

The solution for dynamically generating a NAS volume introduced in this article: On an existing file system, a directory is automatically generated, which is defined as the target volume;

Image address: registry.cn-hangzhou.aliyuncs.com/acs/alicloud-nas-controller:v1.11.5.4–433631d-aliyun

Resources generated by default:

Name of the generated PV: pvc-${pvc-uid}

Name of the generated Directory: namespace-pvcname-pvname

The following declaration can be made in the annotations of the PVC to customize the name:

The generated PV and directory name are defined below.

2. Deploy the NAS Controller

Create alicloud-nas-controller to implement dynamic provider nas pv;

Create alicloud-nas storageclass to provide a template for nas pv provision;

StorageClass usage instructions:

StorageClass example:

3. Create an application — Deployment:

4. Create an application — StatefulSet:

If volumeTemplateClaim is used, pv-name-created is not supported to configure the PV name;

5. Create an application — Pod:

Original Source

https://www.alibabacloud.com/blog/how-to-use-nas-persistent-volumes-dynamically-in-a-kubernetes-cluster_594928?spm=a2c41.13057616.0.0

Follow me to keep abreast with the latest technology news, industry insights, and developer trends.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store