apiVersion: v1
kind: PersistentVolume
metadata:
  name: local-pv-mysql
spec:
  capacity:
    storage: 8Gi
  # volumeMode field requires BlockVolume Alpha feature gate to be enabled.
  volumeMode: Filesystem
  accessModes:
  - ReadWriteOnce
  storageClassName: local-storage-mysql
  persistentVolumeReclaimPolicy: Retain
  local:
    path: /data/k8s/local-storage/mysql
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: node-role.kubernetes.io/master
          operator: Exists