Cloud Native File Storage (CNFS) lets you attach tags to NAS, OSS, and CPFS storage resources directly from a Kubernetes manifest. This enables fine-grained classification and permission management and improves resource administration efficiency.
Prerequisites
Before you begin, ensure that you have:
-
cnfs-controller v1.2.1 or later installed. To upgrade, see Manage the cnfs-controller component
Add tags to storage resources
Create a ContainerNetworkFileSystem resource and set parameters.tags with the key-value pairs to apply. Tags with the same keys as existing tags overwrite those tags. Choose the manifest that matches your storage 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 | Description |
|---|---|
type |
The persistent volume (PV) type. Set to nas. |
reclaimPolicy |
The reclaim policy. Only Retain is supported. Deleting the CNFS resource does not delete the NAS file system. |
parameters.tags |
Tags to apply to the NAS file system. Overwrites any existing tags that share the same keys. |
parameters.filesystemId (Optional) |
The ID of an existing NAS file system to associate. If left blank, CNFS creates a new NAS file system and applies the specified tags. |
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 | Description |
|---|---|
type |
The persistent volume (PV) type. Set to oss. |
reclaimPolicy |
The reclaim policy. Only Retain is supported. Deleting the CNFS resource does not delete the OSS bucket. |
parameters.tags |
Tags to apply to the OSS bucket. Overwrites any existing tags that share the same keys. |
parameters.bucketName (Optional) |
The name of an existing OSS bucket to associate. If left blank, CNFS creates a new bucket named cnfs-oss-<cluster ID> and applies the specified tags. |
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 | Description |
|---|---|
type |
The persistent volume (PV) type. Set to cpfs. |
reclaimPolicy |
The reclaim policy. Only Retain is supported. Deleting the CNFS resource does not delete the CPFS file system. |
parameters.tags |
Tags to apply to the CPFS file system. Overwrites any existing tags that share the same keys. |
parameters.filesystemId (Required) |
The ID of the CPFS file system to associate. |