forked from phnmnl/k8s-volume-test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pv.yml
30 lines (29 loc) · 980 Bytes
/
pv.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
apiVersion: v1
kind: PersistentVolume
metadata:
name: local-storage-pv
annotations:
"volume.alpha.kubernetes.io/node-affinity": '{
"requiredDuringSchedulingIgnoredDuringExecution": {
"nodeSelectorTerms": [
{ "matchExpressions": [
{ "key": "kubernetes.io/hostname",
"operator": "In",
"values": ["erikube-node1-dapeng.onecloud.poc"]
}
]}
]}
}'
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
storageClassName: local-storage
local:
path: /mnt/disks/vol
# "openstack-erikube-node1-dapeng.onecloud.poc" with the name of kubernetes node that is hosting this local storage disk
# "5Gi" with the required size of storage volume, same as specified in PVC
# "local-storage" with the name of storage class to associate with this local volume
# "/mnt/disks/vol" with the path to the mount point of local volumes