Home > Storage > PowerFlex > White Papers > Oracle in Docker Containers Managed by Kubernetes > Step 5: Create Persistent Volume Claim (PVC) and Oracle Pods on PowerFlex
A Persistent Volume Claim (PVC) is a request for storage, similar to how a pod requests a compute resource. A PVC provides an abstraction layer to underlying storage. For example, an administrator could create static persistent volumes (PVs) that can later be bound to one or more persistent volume claims.
After creating the Kubernetes cluster and installing the CSI driver for PowerFlex, create persistent volumes using yaml files. Next, create pods on these volumes by following these steps:
The PVC claim file is as follows:
#1-pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
volume.beta.kubernetes.io/storage-provisioner: csi-vxflexos
finalizers:
- kubernetes.io/pvc-protection
name: pvc-1
labels:
app: oracledb12c
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
storageClassName: vxflexos
The Oracle 12c pod deployment file is as follows:
#2-deployment-Oracle12c.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: orcldb12c
labels:
app: oracledb12c
spec:
selector:
matchLabels:
app: oracledb12c
template:
metadata:
labels:
app: oracledb12c
spec:
containers:
- image: regsrv.brora.com:5000/ora12c
name: orcldb
ports:
- containerPort: 1521
name: orcldb
volumeMounts:
- name: data
mountPath: /ORCL
imagePullSecrets:
- name: oradocreg
securityContext:
runAsNonRoot: true
runAsUser: 54321
fsGroup: 54321
volumes:
- name: data
persistentVolumeClaim:
claimName: pvc-1
The Oracle 12c load balancer service file is as follows:
#3-service-Oracle12c.yaml
apiVersion: v1
kind: Service
metadata:
name: oracledb12c
spec:
type: LoadBalancer
selector:
app: oracledb12c
ports:
- name: client
protocol: TCP
port: 1521
selector:
app: oracledb12c
# kubectl create -f 1-pvc.yaml
# kubectl create -f 2-deployment-Oracle12c.yaml
# kubectl create -f 3-service-Oracle12c.yaml
# kubectl get pv
# kubectl get pvc
# kubectl get pods -o wide
# kubectl get deployments
# kubectl get svc