Deploying HCL Commerce+ with Helm on Kubernetes
Commerce+ supports several deployment configurations. The default configuration mode the provided Helm Chart uses is Vault configuration mode.
Vault is the configuration management tool for Commerce+as it was designed to store configuration data securely. Commerce+ also uses Vault as a Certificate Authority to issue certificates to each application to communicate with one another securely. Therefore, ensure that you have a Vault service available for the Commerce to access. The following steps highlight the minimum requirements before deploying Commerce+.
- Authoring (auth): For site administration and business users to make changes to the site.
-
Live (live): For shopper-facing storefront access.
- Shared (share): Contains the applications that can be consumed by both auth and live environment .
For non-production environments, you can consider the use of
hcl-commerce-vault-helmchart to deploy and initialize Vault for Commerce+ as it can initialize the Vault and populate data for Commerce+.
However, that chart runs Vault in development and non-high availability (HA) mode and does not
handle a Vault token securely. Therefore, it should not be used for production environments.
You can read Vault Concepts for all considerations that must be made to run Vault
in a production setting.
The environment that you create should not be used for a live production site without further consideration toward security hardening, load balancing, ingress routing, and performance tuning.. To operate Commerce+ in a live production environment, you must commit further time and resources to both performance and security considerations.
With load balancing and ingress routing specifically, you can configure which services you want to expose externally, and restrict the remaining services within the cluster network. This configuration limits their access from and exposure to the wider Internet.
Before you begin
- Ensure that you have deployed Vault. Vault is a mandatory component that is used by default as a Certificate Agent to automatically issue certificates, as well as to store and retrieve essential deployment configuration variables and secrets. For more information, see Configuring your Commerce+ environment using Vault
- Ensure that your environment is prepared. To set up the appropriate environment, see Preparing your Commerce+ environment.
Procedure
-
Deploy Supporting Services
You can deploy the supporting services separately from Commerce+ instead of deploying them together with the Commerce+ Helm chart.
- Elasticsearch-based search: Deploy Elasticsearch, ZooKeeper, and Redis.
- Solr-based search: Deploy Redis.
Optional: If you want to deploy Zookeeper and Redis separately from a Commerce+ (instead of deploying together), you can follow the following steps.
Important:- Enable persistence for Elasticsearch, ZooKeeper, and Redis to ensure that search indexes and connector configurations are retained if the containers are restarted.
- Deploy ZooKeeper and Redis by using the Helm chart versions that are compatible
with your Commerce+ Helm chart. The required chart versions are specified in the
hcl-commerce-helmchart/stable/hcl-commerce/Chart.yamlfile in your cloned Commerce+ Helm chart repository. Ensure that the--versionparameter in the deployment commands matches the version specified in this file.
-
Configure Persistent Storage
Required components like NiFi, and the database (PostgreSQL). Use
ReadWriteMany(RWX) volumes for multi-pod access (for example, AssetsPVC) andReadWriteOnce(RWO) for the database.For more information, see Enabling persistent storage.
-
Configure your Commerce+ deployment Helm Chart.
Use the provided hcl-commerce-helmchart to customize your deployment. Review the following topics based on your configuration knowledge and requirements:Note: It is strongly recommended to not modify the default values.yaml configuration file for your deployment. Instead create a copy to use as your customized values file, for example, my-values.yaml. This will allow you to maintain your customized values for future deployments and upgrades.Customize the
values.yaml(for example,my-values.yaml) to define:-
Environment types (auth, live, share).
-
Storage classes or PVCs for persistence.
-
Vault integration settings (for example, token, secrets path).
- For customers upgrading from HCL Commerce Version 9.1 to Commerce+, see Migrating from HCL Commerce Version 9.1 to HCL Commerce+.
-
-
Use Helm to control the deployment of Commerce+.
Once you have finished the configuration of your deployment in your my-values.yaml file and meet the environment prerequisites, you are ready to deploy Commerce+ by using Helm.Important:
- Deploy the auth, live, and share groups into the same Kubernetes namespace to avoid any potential issues.
- First time deployment
- Deploy the share group with release name
demo-qa-shareinto thecommercenamespace.helm install demo-qa-share hcl-commerce-helmchart -f my-values.yaml --set common.environmentType=share -n commerce - Deploy the auth group with the release
name
demo-qa-authinto thecommercenamespace.helm install demo-qa-auth hcl-commerce-helmchart -f my-values.yaml --set common.environmentType=auth -n commerce - Deploy the live group with the release
name
demo-qa-liveinto thecommercenamespace.helm install demo-qa-live hcl-commerce-helmchart -f my-values.yaml --set common.environmentType=live -n commerce
Once the Commerce+ applications are deployed, if you have further configuration changes or image updates, you can use the Helm upgrade command to update the deployment.
- Deploy the share group with release name
- Updating a deploymentTo update a deployment run the following Helm command for the release and environmentType that you want to update.
helm upgrade release-name hcl-commerce-helmchart -f my-values.yaml --set common.environmentType=environmentType -n commerceNote:- There are several considerations when upgrading your deployment with regards
to the Assets Tool and its persisted storage configuration:
- Instead of using commercenfs in the
values.yamlconfiguration file to create the NFS storageclass, it is recommended to create an NFS storageclass manually. Creating a storageclass manually will avoid issues that can be encountered when running the helm upgrade command when deploying separate environment types within a single namespace.To create an NFS storageclass, see nfs-server-provisioner.
- Instead of using commercenfs in the
- If you use the Elasticsearch-based search solution, it is required to use a
completely new persistent volume for NiFi, and clear any existing Zookeeper
data before you redeploy. This is required so that the newer version of the
connectors can be created automatically during the deployment.
- To clear the NiFi data:
- See Persisting search data to create a new Persistent Volume Claim (PVC), and configure the new PVC name in your deployment values.yaml file.
- You can then remove the previous attached persistent volume
claim.
kubectl delete pvc previous_pvc_name -n commerce
- To clear Zookeeper data:
- Delete the existing Zookeeper
instance.
helm delete my-zookeeper -n zookeeper - Remove the existing persistent volume
claims.
kubectl delete pvc --all -n zookeeper
- Delete the existing Zookeeper
instance.
- To clear the NiFi data:
- HCL Cache caches classes that can be modified in newer versions of Commerce+. To avoid errors in de-serializing an old version of the class, it is strongly recommended to clear Redis keys after upgrading Commerce+. Redis keys can be cleared with the Redis flushdb or flushall commands.
- Once you upgrade Commerce+, recreate any customized search profiles and connectors before your next search indexing.
- There are several considerations when upgrading your deployment with regards
to the Assets Tool and its persisted storage configuration:
- Removing a deploymentTo uninstall or delete a deployment run the following Helm command for the release that you want to remove.
helm delete release-name
-
Observe the deployment.
When you install or update Commerce+, the start-up must follow a precise sequence. The Support Container is primarily used for service dependency checks, to ensure that the various Commerce applications are brought online properly, and in the expected order. In addition, it is also used by some utility jobs, such as for TLS certificate generation for secure ingress. The deployment process can take up to 10 minutes depending on the capacity of your Kubernetes worker nodes.
You can check the status of your deployment. The following values are displayed in theStatuscolumn.Running: This container is started.Init: 0/1: This container is pending on another container to start.
You can also observe the following values displayed in theReadycolumn:0/1: This container is started but the application is not yet ready.1/1: This application is ready to use.
-
Build your search index.
- With the Elasticsearch-based search solution:
- Trigger the Build Index
job.
A response with acurl -X POST -k -u spiuser:plain_text_spiuser_password https://tsapp-demoqaauth.mycompany.com/wcs/resources/admin/index/dataImport/build?connectorId=auth.reindex&storeId=41jobStatusIdis displayed. - Check the Build Index job status using the
jobStatusIdvalue that was returned.curl -X GET -u spiuser:plain_text_spiuser_password https://tsapp-demoqaauth.mycompany.com/wcs/resources/admin/index/dataImport/status?jobStatusId=jobStatusId -kA returned value of
0indicates that the build completed successfully.
- Trigger the Build Index
job.
- With the Elasticsearch-based search solution:
-
Access your environments.
By default, the Helm Chart uses the default values of tenant, env, and envtype. If you changed the default values, update the host names that are used within the following step examples.
- Check the gateway IP
address.
kubectl get gateway -n commerce - Get the gateway httproute
hostname.
kubectl get httproute -n commerce - Create the gateway IP and hostname mapping by editing your development environment
hosts file.
#Auth environment <Gateway_IP> www-demoqaauth.mycompany.com cmc-demoqaauth.mycompany.com tsapp-demoqaauth.mycompany.com store-preview-demoqaauth.mycompany.com store-demoqaauth.mycompany.com#Live environment <Gateway_IP> www-demoqalive.mycompany.com cmc-demoqalive.mycompany.com tsapp-demoqalive.mycompany.com store-preview-demoqalive.mycompany.com store-demoqalive.mycompany.com - Access your environment pages and tools with following URLs:
- A Ruby storefront : https://www-demoqaauth.mycompany.com?storeId=41 or https://www-demoqaauth.mycompany.com/ruby
- A Ruby B2B storefront : https://www-demoqaauth.mycompany.com?storeId=42 or https://www-demoqaauth.mycompany.com/rubyb2b
- Commerce Lab (Tooling): https://tooling-demoqa.mycompany.com/tooling/login
- Commerce Lab for HCL Commerce+: https://cmc-demoqa.mycompany.com/lobtools/cmc/ManagementCenter
- Auroraesite:
https://store-demoqaauth.mycompany.com/wcs/shop/en/auroraesite - Aurorab2besite:
https://store-demoqaauth.mycompany.com/wcs/shop/en/aurorab2besite
- For the production environment, a valid certificate must be used.
- For dev or QA environment, if a valid certificate is not used, you will need to accept certificate warnings when accessing the environment from a browser.
https://cmc-demoqaauth.mycompany.com/lobtools/tooling-configurations/transaction-config.jsonhttps://cmc-demoqalive.mycompany.com/lobtools/tooling-configurations/transaction-config.json
Note: For the Preview Store button in tooling, if you encounter this message: The webpage athttps://store-preview-demoqaauth.hclcdev.com/Ruby?storeId=41&WCPreviewToken=KieqlKqZqqGqk6pL0p8IRw&newPreviewSession=truemight be temporarily down or may have moved permanently to a new web address. Then you need to open the given URL in a separate browser tab and accept the warning.
- Check the gateway IP
address.