Setting up persistent storage volumes for a Kubernetes deployment
Enable persistent volume storage for your deployment. This storage allows for assets that to be accessed and persisted.
Catalog and Inventory require a ReadWriteMany (RWX) persistent volume, while
NiFi-app, Registry-app, and the database (PostgreSQL or DB2) require a
ReadWriteOnce (RWO) persistent volume.
Procedure
-
Create a persistent volume.
- Use a commercial cloud offering such as Google FileStore or Microsoft
Azure Files.For example, using Google FileStore:
- Create the FileStore instance using the instructions on the Google FileStore site.
- Consume the file shares within your Kubernetes environemtn, or review the
following sample yaml configuration files.
- For a
PersistentVolume(PV)apiVersion: v1 kind: PersistentVolume metadata: name: hcl-commerce-sample-readwritemany-pv spec: capacity: storage: 5Gi accessModes: - ReadWriteMany mountOptions: - hard - nolock nfs: path: /file-share server: ip-address - For a
PersistentVolumeClaim(PVC)apiVersion: v1 kind: PersistentVolumeClaim metadata: name: hcl-commerce-sample-readwritemany-claim spec: accessModes: - ReadWriteMany storageClassName: "" volumeName: hcl-commerce-sample-readwritemany-pv resources: requests: storage: 5Gi
- For a
- Stand up a cloud agnostic solution, such as Rook Ceph.Note: Be aware of the following when implementing Rook Ceph:
- Rook Ceph can either be installed either as a set of Kubernetes resources or by installation a Helm chart. See the Ceph documentation for more details. .
- The Linux kernel of your PV machine must be built with the RBD module.
- You must create or enable the shared file system
(
cephFileSystems) after the Ceph cluster has been provisioned, and then create a KubernetesStorageClassbacked by this file system. - You require at least three worker nodes for a production cluster.
- Use a commercial cloud offering such as Google FileStore or Microsoft
Azure Files.
-
Set the PVC for your deployment.
When you have set up the storage class that supports RWX persistent volumes, you can specify the storage class name in the following locations:
- assetsPVC/storageClass for Assets PVC
For a manual setup, follow these steps:- Manually create the Persistent Volumes (PVs) and Persistent Volume Claims (PVCs).
- Specify the manually created PVC names under:
- assetsPVC/existingClaim for Assets
For more information, see Required Helm Chart configuration for Commerce+.