creating persistence volume in EKS with path

Viewed 273

I want to create persistence volume with path in EKS, so in local development environment I used following manifest file. I did apply the same manifest file in EKS and it created PV without any error but there is no path directory.

apiVersion: v1
kind: PersistentVolume
metadata:
  name: metadata-collector-data
spec:
  capacity:
    storage: 250G
  volumeMode: Filesystem
  accessModes:
  - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  storageClassName: default-class
  local:
    path: /mnt/content_selection_platform/data/metadata-collector/movies
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: role
          operator: In
          values:
          - cpu-node
1 Answers

The documentation is not very explicit about it, but the discs and directories local Persistent Volumes are mounting need to get pre-provisioned. Hence, it is important to point local Persistent Volumes specifically to the correct node with nodeAffinity.

Related