Providing custom Message Bus Probe configuration files in a persistent volume

You must pre-create the persistent volume claim (PVC) to allow the probe to access the custom probe files like custom JSON parser configuration file, custom pre-parser JavaScript or custom probe rules files in the persistent volume (PV). The PVC must have the access mode ReadWriteMany (RWX) and the storage size must be higher than the total size of files that you want to store in the PV.

Note: This feature is only supported by the Kafka probe, Pulsar probe and Generic Webhook probe integrations.

Providing Configuration Files during Probe Pod Initialization

The following command shows how to copy the local directory to /home/netcool/etc/custom_probe_files in the probe pod and store in the PV during probe pod initialization. You only need to perform this step once for a new PVC. The probe will not start until all files are successfully transferred.

oc rsync ./ <probe pod>:/home/netcool/etc/custom_probe_files -c custom-probefiles-wait --strategy=tar

Updating Configuration Files in the Persistent Volume

The following command shows how to copy the local directory to /home/netcool/etc/custom_probe_files in the probe pod and store in the PV during probe pod initialization. Important: The target directory in the PV must be /home/netcool/etc/custom_probe_files because when the pod starts, this directory is mounted as the base user configuration file directory. You only need to perform this step once for a new PVC. The probe will not start until all files are successfully transferred.

ls -1 ./
message_bus.rules
message_bus_parser_config.json
message_bus_preparser.js

oc rsync  ./ <probe pod>:/home/netcool/etc/custom_probe_files -c custom-probefiles-wait --strategy=tar

Where <probe pod> is the probe pod name configured to load custom configuration file from the PV.

You must run the following commands to scale down the number of replicas to zero and scale up to the desired replica count to ensure that the probe pods reload with the updated configuration file and rules files from the PV.
oc scale deployment <probe deployment> --replicas=0

oc scale deployment <probe deployment> --replicas=<desired replica count>

Updating Probe Rules Files

If you are only updating the custom rules files in the persistent volume, run the following command to trigger the probe to reload the updated rules files. You must run this command on every pod if there is more than one probe pod replica so that all pods run with the same rules.

oc exec <probe pod>  \
-n <namespace>   -it \
-- curl -X PUT http://<probe pod>:8080/probe/common/reloadrules \
-H 'Content-type:application/json' \
-d  '{"reloadrulesflag":1}'