Create the Persistent Volume and the Persistent Volume Claim
The Kubernetes Persistent Volume (PV) and Persistent Volume Claim (PVC) are used as storage locations for the WebLogic domain homes and log files.
PVs and PVCs are described in YAML files. For each PV, you should create one PV YAML file and one PVC YAML file. In the following example, you will find two YAML file samples, one for the volume and one for the claim.
pv.yamlapiVersion: v1
kind: PersistentVolume
metadata:
name: <domain_name>-oke-pv
namespace: <domain_name>-ns
spec:
storageClassName: <service_name>-oke-fss
capacity:
storage: 100Gi
accessModes:
- ReadWriteMany
mountOptions:
- nosuid
nfs:
server: <MOUNT_IP>
path: "/<service_name>"
readOnly: falseHere:
<MOUNT_IP>is the IP of NFS server that is created as part of the stack.<service_name>is the resource_prefix of the stack.
pvc.yamlapiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: <domain_name>-oke-pvc
namespace: <domain_name>-ns
spec:
storageClassName: <service_name>-oke-fss
accessModes:
- ReadWriteMany
resources:
requests:
storage: 100Gi
volumeName: <domain_name>-oke-pvUse the
pv.yaml file to create a PV by running the following
command:$ kubectl apply -f pv.yamlUse the
pvc.yaml file to create a PVC by running the following
command:kubectl apply -f pvc.yamlUse the following commands to
verify:
kubectl get pvckubectl get pvTo view the list of storage classes in your cluster, run the following
command:
$ kubectl get storageclass