How to Run Oracle 19c on Kubernetes with NFS Storage

See how to use Portworx proxy volumes to present external NFS storage to a Kubernetes cluster to provide persistent storage to an Oracle 19c database.


3 minutes
image_pdfimage_print

In this post, I’ll show how you can run an Oracle 19c single instance database on Kubernetes using NFS persistent storage with Portworx proxy volumes.

For this post, I’ll be using Kubernetes v1.17.

Portworx v2.7.0 with Portworx proxy volumes.

And a Pure Storage® FlashBlade® NFS share to provide persistent NFS storage to an Oracle 19c containerized database.

How to Create an NFS Share

If you don’t already have an NFS share, you’ll need to create one. Using the FlashBlade UI, I’ve created a 1TB NFSv3 file system called z-k8-pstg within my lab.

1TB NFSv3 file system called z-k8-pstg
Figure 1: Creating a file system in FlashBlade.

Create the Oracle 19c Database

Kubernetes Deployment

My Kubernetes deployment creates the following:

  • Storage class
  • Deployment
  • Persistent volume claims (PVCs)
  • Service

[root@master-1 Oracle-on-Kubernetes]# kubectl apply -f 19c_deployment_PX-NFS.yaml

Please note: I’ve reused the Kubernetes Namespace, Secret, and ConfigMap from my Oracle 19c Statefulset post, so you may need to review that post first.

Before we try to access our database, let’s take a look at the Kubernetes deployment.

Kubernetes Storage Class

I’ve created a storage class using a Portworx® provisioner with the following parameters:

  • Proxy_endpoint: The endpoint of the FlashBlade NFS share
  • Proxy_nfs_exportpath: The FlashBlade NFS export name
  • Mount_options: The NFS mount options for my container

Kubernetes Persistent Volume Claims

The Portworx proxy volume supports accessing a specific sub-part within an NFS share. I’ve used this to provide the three volumes from a single NFS share for use by the Oracle container.

If you want to confirm your PVC details, you can use kubectl get pvc/<pvc name> -o YAML or -o JSON, for example.

[root@master-1 ~]# kubectl get pvc/ora-data193-nfs -o YAML

Alternatively, you can use kubectl describe pvc/<pvc name>.

In the example above, you can see the Access Modes line and the pod name on the Mounted By line.

Access Modes

Before we move on, you may have noticed that the Access Mode is RWX. This is possible because I’m using NFS, which can provide a shared file system. There are three types of access modes:

  • ReadWriteOnce (RWO): The volume can be mounted as read-write by a single node.
  • ReadOnlyMany (ROX): The volume can be mounted read-only by many nodes.
  • ReadWriteMany (RWX): The volume can be mounted as read-write by many nodes.

A PersistentVolume can be mounted on a host in any way supported by the resource provider.

Kubernetes Pod

Let’s confirm the pod name with kubectl get pod.

Kubernetes Log

Now that you know the pod name, you can watch the database creation with kubectl logs <pod> –follow, for example.

Kubernetes Service

Use kubectl get svc or service to expose the Oracle listener port.

Database Test

Now that the Oracle 19c database is running within a container, let’s try to access it.

Summary

In this post, I’ve shared how you can use Portworx proxy volumes to present external NFS storage to a Kubernetes cluster to provide persistent storage to an Oracle 19c database.

Interested in testing out  proxy volumes? Try Portworx for free or get the Forever Free edition of Portworx Essentials.

Finally, if you’d like to try this out for yourself, you can find the Kubernetes manifests in my GitHub repository.