...
Code Block | ||
---|---|---|
| ||
ALLOW any-user to use virtual-network-family in compartment <compartment-name> where request.principal.type = 'cluster' |
User can use the File Storage service to provision persistent volume claims (PVCs) in two ways:
Dynamic Provisioning
Static Provisioning
Dynamic Provisioning
These steps describe how to create a dynamically provisioned volume using OCI Volume plugin.
...
For more information, please refer to the dynamic provisioning documentation.
Static Provisioning
These steps describe how to create a PVC by creating a PV backed by the new file system and then create the PVC and binds the PVC to the PV backed by the File Storage service.
Prepare a
pv.yaml
file with PersistentVolume manifest for OCI File Storage:
Code Block |
---|
apiVersion: v1
kind: PersistentVolume
metadata:
name: fss-pv
spec:
capacity:
storage: 1Gi
volumeMode: Filesystem
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Delete
csi:
driver: fss.csi.oraclecloud.com
volumeHandle: <filesystem_ocid from terraform output>:<mount_target_IP_address from terraform output>:<filesystem_mount_path from terraform output> |
Deploy the PersistentVolume
Code Block |
---|
kubectl apply -f pv.yaml |
Prepare a
pvc.yaml
file with PersistentVolumeClaim manifest for OCI File Storage
Code Block |
---|
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: fss-pvc
spec:
accessModes:
- ReadWriteMany
storageClassName: ""
resources:
requests:
storage: 1Gi
volumeName: fss-pv |
Deploy the PersistentVolumeClaim
Code Block |
---|
kubectl apply -f pvc.yaml -n uepe |
Verify PVC is bound to the PV successfully
Code Block |
---|
kubectl get pvc -n uepe |
the output below shows persistent volume claim bound to persistent volume successfully
Code Block |
---|
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS VOLUMEATTRIBUTESCLASS REASON AGE
fss-pv 1Gi RWX Delete Available <unset> 9s |
Pod cannot access file system due to insufficient permissions
...