Kuberntes PV PVC 发表于 2018-11-09 | 分类于 Kuberntes PVC12345678910kind: PersistentVolumeClaimapiVersion: v1metadata: name: mysql-volumeclaimspec: accessModes: - ReadWriteOnce resources: requests: storage: 200Gi volume1234567891011121314151617181920212223242526272829apiVersion: apps/v1kind: Deploymentmetadata: name: mysql labels: app: mysqlspec: replicas: 1 selector: matchLabels: app: mysql template: metadata: labels: app: mysql spec: containers: - image: mysql:5.6 name: mysql ports: - containerPort: 3306 name: mysql volumeMounts: - name: mysql-persistent-storage mountPath: /var/lib/mysql volumes: - name: mysql-persistent-storage persistentVolumeClaim: claimName: mysql-volumeclaim