FTM init container support

You can provide an init container that runs before the Financial Transaction Manager application containers start. Your init container can be used to do customized setup for your specific FTM deployment.

When FTM init container support is enabled, each FTM pod has an init container that runs before the FTM containers are started. The same image is used for the init containers for all the FTM pods. Or, you can use different images for the different FTM pods.

Configure FTM init container support

Each FTM container mounts the ftm-shared volume as a Red Hat® OpenShift® emptyDir volume type. You can use the volume to share data and files between the init container and the FTM container.

Custom JAR files can be placed in the /shared/lib folder of the ftm-shared volume. The FTM containers add the JAR files in that folder to their class path.

External secrets can be placed in the /shared/vars.env file. The FTM containers read the secrets from that file instead of from the Red Hat OpenShift secret resources. The containers also encrypt the vars.env file.

Init containers under default are added to every FTM pod. The exclude list can be used to exclude the init container from certain pods. Init containers can also be added under the workloads section to add init containers to specific FTM pods.

The following YAML is an example that explains the format of the custom resource section for the init containers. This init section is under spec in the FTM custom resource. It adds an init container to every FTM pod except the Control Center user interface. It adds a separate init container only to the Control Center user interface.
init:
  default:
    initContainers:
      - name: ftm-init-secrets
        image: <init-image>
        volumeMounts:
          - name: ftm-shared
            mountPath: /shared
        env:
          - name: SHARED_FILE
            value: /shared/vars.env
          - name: POD_NAME
            valueFrom:
              fieldRef:
                apiVersion: v1
                fieldPath: metadata.name
    exclude:
      - core-ui-api
workloads:
  - name: core-ui-api
    initContainers:
      - name: ftm-init-secrets
        image: <core-ui-api-init-image>
        volumeMounts:
          - name: shared
            mountPath: /shared

Adding custom JAR files

Several FTM components can call user exits, which run user code, or access shared libraries. These user exits and shared libraries are provided as JAR files. To make these JAR files accessible, make sure that they are within a component's container.

The init container copies the JAR files into the FTM application pod. The POD_NAME environment variable in the YAML identifies the application pod that the init container is running in. The init container uses this variable to copy the correct application JAR files to the /shared/lib directory.

All the FTM applications, excluding the following list of applications, load the JAR files from the directory /shared/lib:
  • Control Center. For each user interface component, create a separate subdirectory under /shared/lib so that Control Center can load the files properly.
  • Business Rules Server. For each Business Rules Server, create a separate subdirectory under /shared/lib/brs so that Business Rules Server can load the correct files.
The following table shows the Control Center user interface components and their respective user exit locations:
Table 1. Control Center user interface components
Component Location
Services Framework user interface /shared/lib/framework
Core user interface /shared/lib/core
Transaction Server user interface /shared/lib/transaction-server