tencent cloud

Cloud File Storage

Releases Notes and Announcements
Release Notes
Announcements
Product Introduction
Overview
Strengths
Storage Classes and Performance
Use Cases
Recommended Regions
Use Limits
Service Regions and Service Providers
Purchase Guide
Billing Overview
Pricing Overview
General Series Billing
Turbo Series Billing
High-Throughput CFS Billing
Billing Mode
IA ‍Storage Billing
Storage Resource Units
Resource Purchase
Viewing Bills
Arrears Reminder
Getting Started
Creating File Systems and Mount Targets
Using CFS File Systems on Linux Clients
Using CFS File Systems on Windows Clients
Using CFS Turbo on Linux Clients
Using the CFS Client Assistant to Mount File Systems
Operation Guide
Access Management
Managing File Systems
Permission Management
Using Tags
Snapshot Management
Guide for Cross-AZ and Cross-Network Access
Automatically Mounting File Systems
Data Migration Service
User Permission Management
User Quotas
Data Encryption
Data Lifecycle Management
Upgrading Standard File Systems
Practical Tutorial
Selecting Kernels for NFS Clients
Managing Turbo CFS Directories
Terminating Compute Instances
Using CFS on TKE
Using CFS on SCF
Using CFS Turbo on TKE
Using CFS Turbo on TKE Serverless Cluster
Selecting a Network for Turbo CFS
Copying Data
CFS Storage Performance Testing
API Documentation
History
Introduction
API Category
Snapshot APIs
File system APIs
Lifecycle APIs
Other APIs
Data Flow APIs
Making API Requests
Permission Group APIs
Service APIs
Scaling APIs
Data Migration APIs
Data Types
Error Codes
Troubleshooting
Client Use Bottleneck due to Large Number of Small Files or Parallel Requests
FAQs
CFS Service Level Agreement
Contact Us
Glossary

Using CFS on TKE

PDF
フォーカスモード
フォントサイズ
最終更新日: 2024-01-22 22:15:48

Overview

CFS is suitable for two use cases in a container environment:

Use case 1. Persistent storage of Pod/container data (dynamic mounting of CFS recommended)

CFS provides a space for persistent storage where the data is still stored when a Pod or container is terminated. In this way, the original space can be quickly mounted through PVCs to implement data reads/writes quickly when another Pod or container is started. Compared with other schemes, a single-FS instance allows you to store the data from multiple Pods or containers and assign different subdirectories in the CFS instance to different Pods. Standard and High-Performance CFS instances are pay-as-you-go with no requirement for the minimum purchase capacity. This helps reduce the costs of persistent data storage for large-scale containers.

Use case 2. Multi-Pod/container data sharing (static mounting of CFS recommended)

CFS provides shared access to a directory space from multiple Pods or containers over NFS or private protocols for efficient data sharing. Compared with other schemes, this provides higher bandwidth and IOPS capabilities.
This section describes how to deploy a container workload in the Tencent Cloud console. For more information on how to write a YAML file, refer to the YAML file automatically generated after a StorageClass is created in the console.
Note:
Make sure that the CSI component in the TKE cluster is on v1.0.4 or later; otherwise, update it in the TKE console. The update operation does not affect the normal use of the container.

Directions

Dynamically mounting CFS

Note:
This mounting option is recommended for persistent storage of Pod/container data.
1. Create a StorageClass as instructed in Managing CFS Templates by Using a StorageClass.



Key configuration items are as described below:
Configuration Item
Description
Instance creation mode
Select Shared instance.
Availability zone
We recommend you select the same AZ as that of the container host.
Storage type
Select Standard storage or Performance storage as needed.
Protocol version
Unless in scenarios involving concurrent modifications, we recommend you use the NFS v3 protocol for better performance.
Reclaim policy
Select Delete or Retain as needed. To avoid unexpected data deletion, we recommend you select Retain.
2. Create a PVC as instructed in Managing CFS by Using PVs and PVCs.


Key configuration items are as described below:
Configuration Item
Description
Namespace
Select a namespace as needed.
StorageClass
Select the StorageClass you just created.
PersistentVolume
You don't need to specify a PV for dynamic creation. Note: For a StorageClass based on a shared CFS instance, if you don't specify a PV when creating a PVC, the CSI plugin will automatically create a pay-as-you-go CFS instance when creating a PVC. This instance will be deleted when the PVC is deleted. Therefore, process PVCs created in this way with caution.
3. Create a Deployment as instructed in Deployment Management.


Key configuration items are as described below:
Configuration Item
Description
Volume
Name the volume as needed and select the PVC you just created.
Mount point
Select the volume and specify the path for mounting to the container. When you dynamically create a shared CFS instance, you need to specify an environment variable, and the CSI plugin will create a directory in the CFS instance corresponding to the selected PVC based on the value of the configured environment variable for the container to mount.
After completing the configuration, click Create Workload, and the system will create a container based on this configuration and mount CFS.

Statically mounting CFS

Note:
This mounting option is recommended for multi-Pod/container data sharing.
1. Create a StorageClass as instructed in Managing CFS Templates by Using a StorageClass.



Key configuration items are as described below:
Configuration Item
Description
Instance creation mode
Select Shared instance.
Availability zone
We recommend you select the same AZ as that of the container host.
Storage type
Select Standard storage or Performance storage as needed.
Protocol version
Unless in scenarios involving concurrent modifications, we recommend you use the NFS v3 protocol for better performance.
Reclaim policy
Select Delete or Retain as needed. To avoid unexpected data deletion, we recommend you select Retain.
2. Create a PV as instructed in Managing CFS by Using PVs and PVCs.



Key configuration items are as described below:
Configuration Item
Description
Creation method
Select Manual; that is, specify a CFS instance for PV configuration.
StorgeClass
Select the StorageClass you just created.
Select CFS
Select a specified CFS instance. Note: During static creation, make sure that you already have a CFS instance in the same VPC as the container.
CFS subdirectory
CFS allows you to mount subdirectories. You can select different subdirectories and bind them to one or multiple PVs as needed to implement different degrees of data sharing.
3. Create a PVC as instructed in Managing CFS by Using PVs and PVCs.


Key configuration items are as described below:
Configuration Item
Description
Namespace
Select a namespace as needed.
StorageClass
Select the StorageClass you just created.
PersistentVolume
Select Specify and select the PV you just created.
4. Create a Deployment as instructed in Deployment Management.


Key configuration items are as described below:
Configuration Item
Description
Volume
Name the volume as needed and select the PVC you just created.
Mount point
Select the volume and specify the path for mounting to the container. To achieve automatic subdirectory creation, you can use two methods. Method 1: Select subPath as the mount point and enter the name of the path you want to mount, such as test. Then, the CSI plugin will automatically create the test directory under the root path of the file system and automatically mount it to the specified directory of the container. Method 2: Add an environment variable and assign a value to it. Select subPathExpr as the mount point and select the environment variable. The CSI plugin will use the value of the environment variable as the directory name, automatically create the directory under the root path of the file system, and automatically mount it to the specified directory of the container.
After completing the configuration, click Create Workload, and the system will create a container based on this configuration and mount CFS.

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック