Created
October 29, 2019 11:51
-
-
Save takuya-andou/8397d9bce8acd0281d99436ff8a38f8e to your computer and use it in GitHub Desktop.
永続ボリューム
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 参考:https://tkzo.jp/blog/use-persistent-volumes-in-gke/ | |
# volume.yaml | |
apiVersion: v1 | |
kind: PersistentVolume | |
metadata: | |
# 任意のPV名を設定します | |
name: persistvol | |
spec: | |
capacity: | |
# 作成したボリュームの容量と合わせます | |
storage: 30Gi | |
accessModes: | |
- ReadOnlyMany # 下記参照 | |
persistentVolumeReclaimPolicy: Retain # 下記参照 | |
# 任意の名前を設定 | |
storageClassName: cache | |
gcePersistentDisk: | |
# GUIより作成した永続ボリューム名を設定します | |
pdName: for-k8s | |
fsType: ext4 | |
--- | |
apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
# 任意のPVC名を設定します | |
name: persistent-disk | |
spec: | |
accessModes: | |
- ReadOnlyMany # 下記参照 | |
# PVにて設定したものと同様の値を設定します | |
storageClassName: cache | |
resources: | |
requests: | |
# 作成したボリュームの容量と合わせます | |
storage: 30Gi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment