3.5. 创建通用临时卷
流程
-
创建
pod
对象定义,并将其保存到文件中。 在文件中包括通用临时卷信息。
my-example-pod-with-generic-vols.yaml
kind: Pod apiVersion: v1 metadata: name: my-app spec: containers: - name: my-frontend image: busybox:1.28 volumeMounts: - mountPath: "/mnt/storage" name: data command: [ "sleep", "1000000" ] volumes: - name: data 1 ephemeral: volumeClaimTemplate: metadata: labels: type: my-app-ephvol spec: accessModes: [ "ReadWriteOnce" ] storageClassName: "topolvm-provisioner" resources: requests: storage: 1Gi
- 1
- 通用临时卷声明。