Before AI training or data analytics tasks, prefetch massive cold OSS data on demand into high-performance volumes such as CPFS for Lingjun or cloud disks so workloads read at high speed; volumes reclaim automatically after tasks, balancing compute acceleration and cost optimization.
How it works
Feature implementation
This feature uses Kubernetes Volume Populators, managed by ACK's storage-operator. When you create a PVC referencing the OSSVolumePopulator (OSSVP) custom resource, storage-operator intercepts the request and populates data.
Population mode depends on the target volume type:
|
Mode |
Supported storage types |
Description |
|
|
CPFS for Lingjun |
storage-operator leverages CPFS native data flow to populate data. This mode uses no cluster compute resources and is more efficient. |
|
|
Other storage types, such as cloud disks or CPFS general-purpose edition |
storage-operator creates a temporary pod in the This mode consumes cluster compute resources. |
After population succeeds, PVC status changes from Pending to Bound. Application pods can then mount the PVC and access prefetched data.
Typical scenarios
This feature supports two primary use cases.
|
Dimension |
Scenario 1: Prefetch data to CPFS for Lingjun shared volumes |
|
|
Applicable scenario |
High-throughput, read-intensive workloads such as AI model training and inference to overcome OSS access bottlenecks. |
Parallel batch or data pipeline tasks that need isolated read-write workspaces to avoid concurrency conflicts and ensure data isolation. |
|
Technical implementation |
Use CPFS for Lingjun with |
Use dynamically provisioned storage such as cloud disks with |
|
Key characteristics |
|
|
Workflow
VolumePopulator core steps are similar across both modes.
|
|
|
Prerequisites
-
Cluster runs Kubernetes 1.26 or later with the CSI plugin. This feature requires dynamically provisioned storage.
To upgrade your cluster, see Manually upgrade a cluster. To migrate from FlexVolume to CSI, see Migrate FlexVolume to CSI using csi-compatible-controller.
-
Upgrade storage-operator to v1.35.1 or later and enable the
VolumePopulatorFeature Gate.If other feature gates are already enabled, use the format:
xxxxxx=true,yyyyyy=false,VolumePopulator=true
Scenario 1: Prefetch data to CPFS for Lingjun shared volumes
For read-only, high-throughput model training and inference, use CPFS for Lingjun data flow to prefetch models from OSS on demand so multiple GPU tasks can read at high speed.
Prerequisites
-
Complete the preparations for using CPFS for Lingjun dynamic volumes.
-
Review the CPFS for Lingjun data flow (invitational preview) documentation for feature details and limits.
ImportantCPFS for Lingjun data flow is in invitational preview. Performance may fluctuate in large-scale clusters. For issues or product suggestions, join DingTalk group 35532895.
1. Set a specific tag on the OSS bucket
In Object tagging operations, add a tag to your OSS bucket with key cpfs-dataflow and value true.
Do not delete or modify this tag during use—volume creation may fail.
2. Create OSSVolumePopulator (OSSVP)
Create an OSSVolumePopulator in the same namespace as your application and PVC to define the OSS data source.
apiVersion: storage.alibabacloud.com/v1beta1
kind: OSSVolumePopulator
metadata:
name: qwen3-32b
# Must be in the same namespace as the application and PVC
namespace: bmcpfs-dataflow-demo
spec:
bucket: <your-bucket-name>
region: cn-hangzhou
endpoint: oss-cn-hangzhou-internal.aliyuncs.com
path: /Qwen3-32B/
# Dedicated for CPFS for Lingjun volumes, leveraging its data flow capability
mode: bmcpfs-dataflow
# Optional advanced configurations for bmcpfs-dataflow mode
# This example recommends default settings. Ignore if no special requirements.
# bmcpfsDataflow:
# Maximum data flow throughput (MB/s). Options: 600, 1200, 1500. Default: 600
# throughput: 1200
# Enable encrypted transfer. Default: empty (disabled)
# sourceSecurityType: SSL
# Data prefill mode. Default: metadataAndData for full prefill.
# Set to metadata for metadata-only prefill.
# dataType: metadataAndData
Parameters:
|
Name |
Description |
Optional |
Default |
|
|
OSSVolumePopulator must be in the same namespace as the application and PVC. |
No |
N/A |
|
|
OSS bucket name. |
No |
N/A |
|
|
OSS region. |
No |
N/A |
|
|
OSS service endpoint. |
No |
N/A |
|
|
Path prefix within the OSS bucket, such as |
Yes |
|
|
|
Operation mode. Options:
|
Yes |
|
|
|
Maximum CPFS for Lingjun data flow throughput (MB/s). Valid values: |
Yes |
Same as CPFS for Lingjun data flow default |
|
|
Data transfer security protocol, such as |
Yes |
Encryption disabled |
|
|
Data type to sync:
|
Yes |
|
3. Prepare StorageClass and PVC
Create a StorageClass for CPFS for Lingjun, then create a PVC that references the OSSVP with dataSourceRef.
|
Create StorageClass |
Each dynamic volume from this StorageClass creates a Fileset on the backend CPFS for Lingjun. Create different OSSVP resources, to prefill different OSS datasets into different volumes with the same StorageClass. |
|
Create PVC |
Because the StorageClass sets |
4. Verify data prefill status
During population, PVC status stays Pending and changes to Bound after completion.
For bmcpfs-dataflow mode, check real-time CPFS for Lingjun data flow progress with this command:
kubectl -n bmcpfs-dataflow-demo describe ossvp qwen3-32b
-
statusduring population:Bmcpfs Dataflow: 62a4e7ec-fae1-4f11-848f-b57cxxxxxxxx: Data Flow Id: df-29d3ad9e9xxxxxxx Data Flow Task Id: task-2993179xxxxxxxxx File Set Id: fset-2997498xxxxxxxxx File System Id: bmcpfs-29000z8xz3lf5xxxxxxxx Progress: 59% -
statusafter completion:Message: Populated successfully
5. Create workload and use data
After the PVC is Bound, create a workload that mounts it.
This example uses GPU resources. For verification only, create a CPU pod and use kubectl exec to inspect the data.
Resource cleanup guide
After AI training or inference tasks complete, release the CPFS for Lingjun shared volumes and related workloads.
Resources to release:
-
Workloads using the shared volume (in this example, a
StatefulSet) -
PVC used for data prefilling
-
Backend storage resources (CPFS for Lingjun FileSet) automatically created by the PVC
Cleanup steps:
-
Delete the workload
Delete the StatefulSet using the volume to release the PVC.
kubectl delete statefulset demo-apply-qwen3-32b -n bmcpfs-dataflow-demo -
Delete the PVC
With
reclaimPolicy: Deleteon the StorageClass, deleting the PVC also deletes the backend CPFS FileSet, releases storage, and stops billing.kubectl delete pvc qwen3-32b -n bmcpfs-dataflow-demo -
Verify resource cleanup:
-
In the NAS console, choose File System > File System List and confirm the FileSet for this PVC is deleted and used capacity decreased.
-
OSS source data is unaffected. In the OSS console, confirm the dataset remains intact.
-
Scenario 2: Prefetch data to isolated cloud disk volumes
For batch processing workflows, use Argo Workflows to dynamically create and preheat an independent cloud disk per task for data isolation and elasticity.
Prerequisites
-
Enable
VolumePopulatorPodHandlerin storage-operator.After enabling, the system grants required RBAC permissions to related components and temporary pods. Evaluate security risks before enabling.
-
Argo Workflows is installed.
-
This example uses serverless compute (ECI) for data prefilling tasks and workflows. Install the ack-virtual-node add-on . For non-serverless verification, remove
alibabacloud.com/eci: "true"from resources.
1. Authorize data prefilling tasks to access OSS
In generic mode, data prefilling tasks run as temporary pods in the ack-volume-populator namespace. Grant these pods access to the OSS bucket with source data.
-
RRSA method: Dynamically assigns temporary, auto-rotating RAM roles to pods for fine-grained permission isolation with higher security.
-
AccessKey method: Stores static, long-term credentials in a Secret. Simple to configure but less secure.
RRSA method
1. Enable RRSA in the cluster
-
Log on to the ACK console. In the left-side navigation pane, click Clusters. On the Clusters page, click the name of the target cluster.
-
On the Basic Information tab, in the Security and Auditing section, click Enable next to RRSA OIDC, and follow the on-screen instructions to enable RRSA during off-peak hours.
When the cluster status changes from Updating to Running, RRSA is enabled.
ImportantAfter RRSA is enabled, the maximum validity period of ServiceAccount tokens that are newly created in the cluster is limited to 12 hours.
2. Create a RAM role and grant permissions
Create a RAM role for pods to assume for OSS access through RRSA authentication.
AccessKey method
-
Create a RAM user. Skip this step if a RAM user already exists. Go to the RAM console - Create User page and create a RAM user as instructed, for example, set the login name and password.
-
Create a permission policy.
Following the principle of least privilege, create a custom policy granting access to the target OSS bucket (OSS read-only or read-write permissions).
Go to the RAM console - Create Policy page, switch to JSON Editor, and configure the policy script as instructed.
-
Attach the policy to the RAM user.
-
Go to the RAM console - Users page. In the user list, find the target user and click Add Permissions in the Actions column.
-
In the Policies section, search for and select the policy created in the previous step, and then complete the authorization.
-
-
Create an AccessKey for the RAM user to store as a Secret for data prefilling.
-
Go to the RAM console - Users page, click the target user in the RAM user list, then in the AccessKey tab, click Create AccessKey.
-
Follow the instructions to create the AccessKey in the dialog box and securely store the AccessKey ID and AccessKey Secret.
-
-
Create a Secret in the cluster.
Use the following YAML to create a Secret in the
ack-volume-populatornamespace to store the AccessKey.apiVersion: v1 kind: Secret metadata: name: oss-secret # The namespace must be set to ack-volume-populator namespace: ack-volume-populator stringData: # Replace with the previously obtained AccessKey ID accessKeyId: <your-AccessKey-ID> # Replace with the previously obtained AccessKey Secret accessKeySecret: <your-AccessKey-Secret>
2. Create OSSVolumePopulator (OSSVP)
Create an OSSVolumePopulator in the same namespace as your application and PVC. Set mode to generic and configure authorization.
apiVersion: storage.alibabacloud.com/v1beta1
kind: OSSVolumePopulator
metadata:
name: generic-demo
# Must be in the same namespace as the application and PVC
namespace: argo
spec:
bucket: my-test-bucket
region: cn-hangzhou
endpoint: oss-cn-hangzhou-internal.aliyuncs.com
path: /many-files/
# Generic mode for any backend storage volume
mode: generic
generic:
# Add labels to data population task pods for scheduling to ECI pods
labels:
alibabacloud.com/eci: "true"
# Add annotations to data population task pods for configuring ECI specs
annotations:
k8s.aliyun.com/eci-use-specs: "2-4Gi"
# Choose either secretRef or rrsaConfigs
# secretRef: oss-secret
rrsaConfigs:
# ARN of the RAM role used for RRSA authorization
roleArn: "acs:ram::1234567*****:role/oss-populator"
# ARN of the cluster's OIDC Provider
oidcProviderArn: "acs:ram::1234567*****:oidc-provider/my-oidc-provider"
# Configure affinity for data population task pods to schedule to specific nodes
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "disktype"
operator: NotIn
values:
- "hdd"
# Configure tolerations for data population task pods
tolerations:
- key: "virtual-kubelet.io/provider"
operator: Equal
value: "alibabacloud"
effect: NoSchedule
# Maximum throughput (MB/s)
# throughput: 1000
Parameters:
|
Name |
Description |
Optional |
Default |
|
|
OSSVolumePopulator must be in the same namespace as the application and PVC. |
No |
N/A |
|
|
OSS bucket name. |
No |
N/A |
|
|
OSS region. |
No |
N/A |
|
|
OSS service endpoint. |
No |
N/A |
|
|
Path prefix within the OSS bucket, such as |
Yes |
|
|
|
Operation mode. Options:
|
Yes |
|
|
|
Labels for data population task pods to schedule to ECI. |
Yes |
N/A |
|
|
Annotations for data population task pods to configure ECI specs. |
Yes |
N/A |
|
|
Secret name storing the AccessKey. Use this or |
Yes |
N/A |
|
|
ARN of the RAM role used for RRSA authorization. Go to the RAM console - Roles page, click the RAM role name, and get it from the details page. |
Required when using RRSA |
N/A |
|
|
ARN of the cluster's OIDC Provider. Go to the ACK clusters page, click the target cluster name, select Cluster Information, and get it from the Basic Information tab under RRSA OIDC. |
Required when using RRSA |
N/A |
|
|
Affinity for data population task pods to schedule to specific nodes. |
Yes |
N/A |
|
|
Tolerations for data population task pods. |
Yes |
N/A |
|
|
Maximum throughput (MB/s) for data population task pods. Unlike |
Yes |
Unlimited (actual rate depends on node network, CPU, and storage write performance) |
3. Prepare StorageClass
This scenario needs a StorageClass for dynamically provisioning cloud disks. ACK provides a default StorageClass and supports manually creating a StorageClass.
-
This example uses
alicloud-disk-essdwithreclaimPolicyset toDeleteandvolumeBindingModeset toImmediate, suitable for serverless compute without zone awareness. -
For non-serverless workflows, use a StorageClass with
volumeBindingModeset toWaitForFirstConsumer(such asalicloud-disk-topology-alltype) so cloud disks and application pods are created in the same zone.
4. Create Argo Workflow
This Workflow example uses an ephemeral volumeClaimTemplate to create an independent cloud disk with prefilled data for each parallel task.
After creating the Workflow, check logs from any task pod to confirm prefilled data reads succeed.
In production, use Argo Workflows Artifact to persist final computation results in OSS.
# Replace <your-workflow-pod-name> with the actual pod name
kubectl -n argo logs <your-workflow-pod-name>
Expected output:
Subtask started, ID: 1
Creating a new log file...
Listing contents from the disk populated by OSSVP:
1-logs
lost+found
results-2025-04-16T07:48:00Z
...
Subtask completed, ID: 1
Result analysis:
-
1-logs: File written by the task, confirming read-write access and isolated storage between parallel tasks. -
results-2025-04-16T07:48:00Zand similar files: Data prefilled from OSS to the cloud disk. -
lost+found: Directory created during file system formatting. Ignore it.
Resource cleanup guide
After batch processing tasks complete, release isolated cloud disk volumes and Argo Workflow instances.
Resources to release:
-
Argo Workflow instance
-
Temporary PVCs automatically created by the Workflow
-
Backend storage resources (cloud disks) automatically created by the PVCs.
Release steps:
-
Delete the Argo Workflow:
Delete the
Workflowresource. Withephemeralvolume claims, deletion cascades to all PVCs.StorageClassreclaimPolicy: Deletethen deletes backend cloud disks, releases resources, and stops billing.# Replace <workflow-name> with the actual Workflow name kubectl -n argo delete workflow <workflow-name> -
Verify resource cleanup:
-
Run
kubectl -n argo get pvcto confirm all workflow-related PVCs are deleted. -
Verify cloud disk resources: Go to ECS console - Block Storage - Disks and confirm no cloud disk resources remain from this workflow.
-
OSS source data is unaffected. In the OSS console, confirm the dataset remains intact.
-
Apply in production
-
Cost and resource management:
-
Set
reclaimPolicy: Deleteon the StorageClass for dynamically created volumes so high-performance storage cleans up automatically after tasks complete. -
In
genericmode, configureaffinityandtolerationsinOSSVolumePopulatorto schedule temporary task pods on lower-cost serverless compute (including ACS, ECI) or spot instances. -
Request PVC
storagelarger than the source data size, or population fails from insufficient space.
-
-
Performance and stability:
-
Set StorageClass
volumeBindingModetoWaitForFirstConsumeron ECS nodes so cloud disks and application pods are created in the same zone. -
For CPFS for Lingjun, choose
dataType: metadatafor faster PV readiness if first-read latency is acceptable, ordataType: metadataAndDatafor full prefill and high first-read performance. -
Monitor prefill status with
kubectl describe ossvp <name>for quick troubleshooting.
-
-
Security and permissions:
-
In
genericmode, prefer RRSA over AccessKey when granting OSS access to data population task pods.
-
Billing
This feature incurs the following charges:
-
High-performance storage fees based on the created volume type (such as CPFS for Lingjun or cloud disks) and their lifecycle.
-
OSS storage fees for source data.
-
Data transfer fees: Configure the OSS internal endpoint in OSSVP to avoid traffic charges. A public endpoint incurs traffic fees.
-
Compute resource fees (only for
genericmode): Temporary pods consume cluster compute resources (CPU, memory, bandwidth) and are billed by specifications and duration. -
For CPFS for Lingjun in
bmcpfs-dataflowmode, data stream tasks are free to use because the data stream feature is in public preview.
FAQ
After prefilling completes, if I update source files in OSS, will the data in the volume sync automatically?
No. Data prefilling is one-time during volume creation. After population, volume contents are decoupled from OSS source data, and later OSS changes do not sync.
Why does my PVC stay in Pending status?
Pending is normal during data prefilling. If it persists, troubleshoot as follows:
-
kubectl describe pvc <pvc-name> -n <namespace>: Check PVC events for populator errors. -
kubectl describe ossvp <ossvp-name> -n <namespace>: Check OSSVP status and events for population progress or failures. -
In
genericmode, check failed pods in theack-volume-populatornamespace and review logs. Common causes include insufficient OSS permissions, network issues, or insufficient storage space.