HCL Cache Redis connection configuration

The HCL Cache uses the Redisson Redis client to interface with the Redis server. You can configure Redisson by editing a YAML configuration file.

Redisson configuration file

Redisson supports multiple Redis server topologies, including standalone and clustering. The configuration of the connection, including options such as timeouts, SSL and authentication is stored in a YAML configuration file. This file is defined in the HCL Commerce Helm chart and stored in a Kubernetes configuration map. The YAML configuration file is referenced from the Redis/yamlConfig element in the custom configuration file. Its default location is /SETUP/hcl-cache/redis_cfg.yaml. Customize the Redisson YAML configuration file to match the topology of your Redis server (either standalone or cluster), and specify the Redis server hostnames, tune pools and retries. You can also use the configuration file to set up security options such as passwords and SSL.

Two sample configuration files are provided, one for a standalone setup, and one for a Redis cluster:

The HCL Commerce Helm chart and values.yaml file

The hclCache element in the HCL Commerce chart allows you to customize the configuration map prior to install, or for helm upgrade.
hclCache:
  configMap:
    # content for cache_cfg-ext.yaml
    cache_cfg_ext: |-
      redis:
        enabled: true
        yamlConfig: "/SETUP/hcl-cache/redis_cfg.yaml" # Please leave this line untouched
    # content for redis_cfg.yaml
    redis_cfg: |-
      singleServerConfig:
        idleConnectionTimeout: 10000
        connectTimeout: 3000
        timeout: 1000
  ...

Validating the current client configuration

The Redis client configuration is stored in Kubernetes configuration maps. The contents of the configuration maps are mounted as volumes and made available to the Commerce pods.
kubectl get configmap -n commerce
NAME                                    DATA   AGE
demo-qa-auth-demoqa-hcl-cache-config    2      15d
demo-qa-live-demoqa-hcl-cache-config    2      15d
demo-qa-share-demoqa-hcl-cache-config   2      15d

kubectl describe configmap -n commerce demo-qa-auth-demoqa-hcl-cache-config
kubectl edit configmap -n commerce demo-qa-auth-demoqa-hcl-cache-config
Important: If you make changes to one configmap, replicate the same changes on the other.