Skip to content

Instantly share code, notes, and snippets.

@takuya-andou
Created October 29, 2019 11:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takuya-andou/8397d9bce8acd0281d99436ff8a38f8e to your computer and use it in GitHub Desktop.
Save takuya-andou/8397d9bce8acd0281d99436ff8a38f8e to your computer and use it in GitHub Desktop.
永続ボリューム
# 参考: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