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:–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

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