EventStore / replicator

Real-time replication tool
https://replicator.eventstore.org
Apache License 2.0
20 stars 13 forks source link

DEV-72 - Add Helm chart support for transform.js #75

Closed iblazhko closed 9 months ago

iblazhko commented 1 year ago

When we need to use custom JS transform in Replicator, we specify

transform:
  type: js
  config: ./transform.js

in replicator configuration.

Problem is that this configuration references an external file that is currently not in Helm chart. Helm does not allow to mount external files into pod at the time of the deployment, see Helm issue https://github.com/helm/helm/issues/3276.

This change adds a transform.js file into Helm chart that we can reference in our configuration during deployment. the content of this file is set from chart values, and we can overwrite this during installation.

By default, the transform file is not used and the content of transform.js is empty.

To use the transform, we need to overwrite transform section in application configuration, and overwrite transform.js file content:

helm install replicator-with-transform \
  es-replicator/es-replicator \
  --values values.yml \
  --set-file transformJs=./local-transform.js

values.yml should overwrite transform section:

transform:
  type: js
  config: ./transform.js

Local file local-transform.js should define transformations / filters as per https://replicator.eventstore.org/docs/features/transforms/js/.

Refs: https://github.com/EventStore/replicator/issues/74

alexeyzimarev commented 1 year ago

I need to check why the UI fails building.