PersistentVolume 作成
pv001
という名前で、サイズは1Gi
アクセスモードReadWriteMany
を利用し、Persistent Volumeを作成します
VolumeType はhostPath
で、場所は/tmp/app-config
です
チートシート
vi pv001.yaml
(修正前)pv001.yaml
(修正中1)pv001.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv0003
spec:
capacity:
storage: 5Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Recycle
storageClassName: slow
mountOptions:
- hard
- nfsvers=4.1
nfs:
path: /tmp
server: 172.17.0.2
volumes:
- name: test-volume
hostPath:
# directory location on host
path: /data
# this field is optional
type: Directory
(修正後)pv001.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv0001 # 名前
spec:
capacity:
storage: 1Gi # 1Gi
accessModes:
- ReadWriteMany # アクセスモード
hostPath:
# directory location on host
path: /tmp/app-config
kubectl apply -f ./pv001.yaml