Persisting the Decision Center ruleset cache

To avoid the risk of loosing Decision Center build files, you need to set up some persistence of the ruleset cache.

About this task

You can define where the cache of a ruleset compiled version is located on the file system of a Decision Center pod. This setting allows you to save time when you redeploy a ruleset to the Decision Server. For more information, see Decision Center settings.

In a Kubernetes context, the following limitations can be observed:

  • If no persistence is defined, the ruleset cache files are lost after a Decision Center pod restart.
  • If the deployment is scaled up, the ruleset cache is not shared by multiple Decision Center pods.

To remediate these limitations, implement the following solutions:

  1. Define a Decision Center persistence storage with a specific /config/customlib file path.
  2. Define Decision Center JVM options to set the location of the build ruleset cache.

Procedure

  1. Create a Persistent Volume Claim (PVC).

    The standard way to manage storage on Kubernetes is to use Persistent Volumes (PV). If only one Decision Center pod is deployed, the ReadWriteOnce access mode is sufficient. If Decision Center is scaled up for better performance, it is preferable to switch to ReadWriteMany PVC access mode External link opens a new window or tab so that all the Decision Center pods write to the storage volume. Depending on the platform, you need to select the appropriate storage for the ReadWriteMany access mode. For example, on OpenShift®, refer to here External link opens a new window or tab for the supported storage volumes corresponding to the access modes.

    1. Create a PersistentVolumeClaim YAML file named custom-dc-libs-pvc.yaml.
      apiVersion: v1
      kind: PersistentVolumeClaim
      metadata:
        name: my-custom-dc-libs-pvc
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 1Gi
    2. Create the PersistentVolumeClaim.
      kubectl create -f custom-dc-libs-pvc.yaml

      The my-custom-dc-libs-pvc Kubernetes resource is created.

    3. Bind the PVC to the Helm Chart parameter customlibPvc.
      decisionCenter:
        customlibPvc: my-custom-dc-libs-pvc
      The Persistent Volume is bound to the /config/customlib file path inside the Decision Center container.
  2. Define a custom Decision Center JVM options configmap.

    The Decision Center deployment on a Kubernetes cluster uses the following default JVM options that are stored in a configmap.

    -Duser.timezone=Europe/Paris
    -Dcom.ibm.jsse2.overrideDefaultTLS=true
    -Dclient.encoding.override=UTF-8
    -Dfile.encoding=UTF-8
    -Djdk.nativeDigest=false

    To use the same location of the ruleset cache for all Decision Center pods, you must combine the user.name and the ilog.rules.teamserver.build.path JVM options and associate them to the /config/customlib file path. This file path is bound to the previously created my-custom-dc-libs-pvc Persistent Volume Claim.

    1. Create a Decision Center JVM options configmap named my-dc-jvm-options-configmap.yaml.
      apiVersion: v1
      kind: ConfigMap
      metadata:
        name: my-dc-jvm-options-configmap
      data:
        dc-jvm-options: |
          -Duser.timezone=Europe/Paris
          -Dcom.ibm.jsse2.overrideDefaultTLS=true
          -Dclient.encoding.override=UTF-8
          -Dfile.encoding=UTF-8
          -Djdk.nativeDigest=false
          -Dilog.rules.teamserver.build.path=/config/customlib/buildcache
          -Duser.name=all
      
    2. Create the configmap.
      kubectl create -f my-dc-jvm-options-configmap.yaml

      The my-dc-jvm-options-configmap Kubernetes resource is created.

    3. Bind the configmap to the Helm Chart parameter jvmOptionsRef.
      decisionCenter:
        jvmOptionsRef: my-dc-jvm-options-configmap
  3. Here is an example of the Helm chart, like my-values.yaml, setting these PVC and configmap parameters:
    license: true
    image: 
      repository: cp.icr.io/cp/cp4a/odm
      pullSecrets: 
      - ibm-entitlement-key
    usersPassword: my-password
    internalDatabase: 
      persistence:
        enabled: false
    
    # Setting PVC and JVM options configmap parameters
    decisionCenter:
      customlibPvc: my-custom-dc-libs-pvc
      jvmOptionsRef: my-dc-jvm-options-configmap
    
    
    Install Operational Decision Manager with this custom Helm chart:
    helm install myodmrelease -f my-values.yaml ibm-helm/ibm-odm-prod
    For more information about installation, see Installing a Helm release of ODM for production.