All Products
Search
Document Center

Container Service for Kubernetes:Manage tags for NAS, OSS, and CPFS using CNFS

Last Updated:Mar 11, 2026

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

type

The type of persistent volume (PV) to create. Set this parameter to nas.

reclaimPolicy

The reclaim policy. Only Retain is supported. When you delete the CNFS resource, the NAS file system is not deleted to prevent data loss.

parameters.tags

Add tags to the NAS file system. This parameter overwrites any existing tags with the same keys on the NAS file system.

parameters.filesystemId

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

type

The type of persistent volume (PV) to create. Set this parameter to oss.

reclaimPolicy

The reclaim policy. Only Retain is supported. When you delete the CNFS resource, the OSS bucket is not deleted to prevent data loss.

parameters.tags

Add tags to the OSS bucket. This parameter overwrites any existing tags with the same keys on the OSS bucket.

parameters.bucketName

The name of the OSS bucket to associate. If left empty, a new OSS bucket named cnfs-oss-<cluster ID> is automatically created and tagged as specified.

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

type

The type of persistent volume (PV) to create. Set this parameter to cpfs.

reclaimPolicy

The reclaim policy. Only Retain is supported. When you delete the CNFS resource, the CPFS file system is not deleted to prevent data loss.

parameters.tags

Add tags to the CPFS file system. This parameter overwrites any existing tags with the same keys on the CPFS file system.

parameters.filesystemId

The ID of the CPFS file system to associate. This parameter is required.