0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

CKA試験、PersistentVolume

Posted at

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

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?