In Container Service for Kubernetes (ACK), you can attach a persistent volume claim (PVC) to a deployment when creating it from an image. This topic shows how to attach a PVC backed by cloud storage to an image-based deployment and verify that the pod mounts the PVC correctly.
To create an application from a template and specify a PVC in the template, see Disk volume overview.
Prerequisites
Before you begin, ensure that you have:
-
An ACK Serverless cluster. For more information, see ACK Serverless quick start.
-
A PVC named
pvc-diskcreated based on cloud storage. For more information, see Create a PVC.
Attach a PVC to a deployment
This procedure covers three stages:
-
Create a deployment from an image and configure its basic settings.
-
Select the
pvc-diskPVC as a data volume in the container configuration. -
Verify that the pod is bound to the PVC.
Steps:
-
Log on to the ACK console.
-
In the left-side navigation pane of the ACK console, click Clusters.
-
On the Clusters page, find the cluster that you want to manage and click the cluster name or click Details in the Actions column.
-
In the left-side navigation pane of the cluster details page, choose Workloads > Deployments.
-
On the Deployments page, click Create from Image.
-
On the Basic Information wizard page, configure the basic settings. For more information, see Configure basic settings.

-
On the Container wizard page, select an image and configure a data volume:
-
Under the data volume section, select the
pvc-diskPVC. -
Click Next.
ACK supports cloud disks, NAS file systems, and Object Storage Service (OSS) buckets as cloud storage backends. This example uses a cloud disk-backed PVC.
For more information, see Configure the containers.
-
-
On the Advanced wizard page, create a service for the
test-nginxapplication and click Create. -
On the Creation Task Submitted page, click View Details to open the application details. The Basic Information page of the
test-nginxapplication appears by default. -
On the Pods tab, find the pod that belongs to the application and click View Details.
-
On the Overview page of the pod, click the Volumes tab and verify that
pvc-diskappears in the volume list.
What's next
To learn more about persistent storage options in ACK, see Disk volume overview.