# https://www.qikqiak.com/k8strain/storage/local/
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: octopus-mysql-data-pv
spec:
  capacity:
    storage: 20Gi
  volumeMode: Filesystem
  accessModes:
    - ReadWriteOnce
  #  persistentVolumeReclaimPolicy: Delete
  storageClassName: local-path
  local:
    path: /data/k8s/local-pv  # ydzs-node1节点上的目录
  nodeAffinity:
    required:
      nodeSelectorTerms:
        - matchExpressions:
            - key: kubernetes.io/hostname
              operator: In
              values:
                - node-tokyo-0
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: octopus-mysql-data
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 20Gi
  storageClassName: local-path