Use Persistent Volume Claims (PVC)
After a PersistentVolumeClaim (PVC) is created, you can use the PVC when you create a pod.
A cloud disk cannot be mounted across availability zones (AZs). Therefore, after a PVC of the
volumeBindingMode: Immediatetype is created, the pod/workload that uses the PVC must be prevented from running in the same AZ of the PV/PVC by using nodeSelector/nodeAffinity.At present, LDC Hybrid Cloud (LHC) is not connected to Alibaba Cloud NAS or cloud disk storage. To use the storage feature, you must install third-party storage plug-ins.
Prerequisites
You have created a PVC. For more information, see Create a PVC.
Procedure
Go to the Clusters page.
Click the name of the target cluster to go to the Cluster Details page and click the Workload tab.
In the left-side menu, click Pods, and then click Create Pods.
In the input box that appears, enter the YAML content, and then click Submit.
Example:
apiVersion: v1 kind:Pod metadata: name: pod-with-disk namespace:default labels: app: nginx spec: tolerations: - key: node.kubernetes.io/unreachable effect:NoSchedule operator:Exists automountServiceAccountToken:false containers: - name: busybox image: reg-cnsh-nf.cloud.alipay.com/library/busybox command:["sleep","3000"] ports: - containerPort:80 volumeMounts: - name: data mountPath:"/data" volumes: - name: data persistentVolumeClaim: claimName: test-pvcAfter the container runs, the status of the pod changes to Running.
# kubectl get pod NAME READY STATUS RESTARTS AGE pod-with-disk 1/1Running0103s