Cloud Native File Storage (CNFS) supports adding tags to NAS, OSS, and CPFS cloud storage resources. This enables fine-grained classification and permission management and improves resource administration efficiency.
Preparations
Ensure that cnfs-controller v1.2.1 or later is installed. To upgrade the component, see Manage the cnfs-controller component.
Add tags to storage resources
To create a CNFS resource and add tags, choose the method that is appropriate for your storage resource type.
NAS file system
apiVersion: storage.alibabacloud.com/v1beta1
kind: ContainerNetworkFileSystem
metadata:
name: test-cnfs-nas
spec:
description: "cnfs"
type: nas
reclaimPolicy: Retain
parameters:
tags:
key1: val1
key2: val2
filesystemId: 35e9f*****Parameter descriptions:
Parameter | Description |
| The type of persistent volume (PV) to create. Set this parameter to |
| The reclaim policy. Only |
| Add tags to the NAS file system. This parameter overwrites any existing tags with the same keys on the NAS file system. |
| The ID of the NAS file system to associate. If left empty, a new NAS file system is automatically created and tagged as specified. |
OSS Bucket
apiVersion: storage.alibabacloud.com/v1beta1
kind: ContainerNetworkFileSystem
metadata:
name: test-cnfs-oss
spec:
description: "cnfs"
type: oss
reclaimPolicy: Retain
parameters:
tags:
key1: val1
key2: val2
bucketName: cnfs-oss-****Parameter descriptions:
Parameter | Description |
| The type of persistent volume (PV) to create. Set this parameter to |
| The reclaim policy. Only |
| Add tags to the OSS bucket. This parameter overwrites any existing tags with the same keys on the OSS bucket. |
| The name of the OSS bucket to associate. If left empty, a new OSS bucket named |
CPFS file system
apiVersion: storage.alibabacloud.com/v1beta1
kind: ContainerNetworkFileSystem
metadata:
name: test-cnfs-cpfs
spec:
description: "cnfs"
type: cpfs
reclaimPolicy: Retain
parameters:
tags:
key1: val1
key2: val2
filesystemId: cpfs-0075cb**********Parameter descriptions:
Parameter | Description |
| The type of persistent volume (PV) to create. Set this parameter to |
| The reclaim policy. Only |
| Add tags to the CPFS file system. This parameter overwrites any existing tags with the same keys on the CPFS file system. |
| The ID of the CPFS file system to associate. This parameter is required. |