
Setting up persistent storage volumes for a Kubernetes deployment
Persistent storage is required in select circumstances for your Kubernetes deployment.
The Assets Tool was reintroduced in HCL Commerce 9.1.8.0. This tool requires persistent volume storage for your deployment. This storage allows for all assets that are added and managed via the Assets Tool in Management Center for HCL Commerce to be accessed and persisted.
For more information on the Assets Tool, see Assets tool.
Solr-based search parallel indexing is supported in the HCL Commerce Kuberentes Helm Chart from 9.1.16.0. The index data for shards must be persisted and accessible by the master search service.
For more information on the requirements for the Solr-based index sharding, see Solr search sharding.
To make files accessible by multiple pods across your deployment, and to allow for the files
to be persisted, a ReadWriteMany
type of persistent volume is required.
For more information on persistent volumes in Kubernetes, see Persistent Volumes in the Kubernetes documentation.
Note: If you are not planning on using the Assets Tool or Solr Search
sharding within your deployment, then persistent storage is not required.
Procedure
-
Create a persistent volume.
- Use a commercial cloud offering such as Google
FileStore, Amazon Elastic File System, or Azure Files.For example, using Google FileStore:
- Create the FIleStore instance.
- Consume the file shares within your Kubernetes
environment, 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 as a set of Kubernetes resources, or by installing a Helm Chart.
- The Linux kernel of your PV machine must be built with the RBD module (Ubuntu has the necessary module required).
- You must create or enable the shared file system
(
cephFileSystems
) after the Ceph cluster has been provisioned, and then create a KubernetesStorageClass
backed by this file system. - You require at least three worker nodes for a production cluster.
- If you want to explore the Assets Tool or Solr-based search parallel indexing
within a non-production deployment, you can use nfs-server-provisioner.
An example of this is as follows:
-
- Add the Helm
repository.
helm repo add kvaps https://kvaps.github.io/charts
- Create a storage class to be used by the PVC.
helm install sample-nfs-server-provisioner kvaps/nfs-server-provisioner --version 1.3.1 --set=persistence.enabled=true, persistence.storageClass="${CLOUD_STORAGE_CLASS}", persistence.size=${STORAGE_SIZE}, storageClass.create=true, storageClass.name=${STORAGE_CLASS}, storageClass.mountOptions={vers=4.1} -n ${NAMESPACE}
- Add the Helm
repository.
-
- Use a commercial cloud offering such as Google
FileStore, Amazon Elastic File System, or Azure Files.
-
Set the PVC for your deployment.
For more information on the requirements for the Assets tool, see Persistent volume for the Assets Tool within Required Helm Chart configuration for HCL Commerce Version 9.1.