Saturday, October 13, 2018

How To Add PersistentVolume of K8S From Oracle OCI File System(NFS)

You need to create  File system and mount targets in OCI first, then we can let K8S to mount them and use . Please refer official Oracle Doc

Then to create NFS PV , PVC in K8S

  • Create Peresistent Volumes DB NFS Files storage. /cas-data is the mount target created in OCI File system . yaml is like
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: livesqlsb-pv-nfs-volume1
spec:
  capacity:
    storage: 300Gi
  accessModes:
    - ReadWriteMany
  nfs:
    path: "/cas-data"
    server: 100.106.148.12

  • Create Persistent Volumne Claim for DB NFS file storage. yaml is like
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: livesql-pv-nfs-claim1
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 300Gi

No comments: