Reputation: 83
We are trying to setup 2 instances of schema registry on docker. Our docker build and publish is auomated and hence will assign any available worker node/port number for the containers.
How can we update the advertised listener configuration on schema registry properties file dynamically? It should be updated by the worker node name and port assigned.
We can't use confluent docker image. So we are creating one. I was able to pass the worker node name through environment variable. Now i need to set it as rest.advertised.host.name. I tried adding the env variable in the property file. It didnt work. Is there any way i can set the property dynamicalyl?
Upvotes: 1
Views: 210
Reputation: 191983
I tried adding the env variable in the property file
Not clear how you tried. You can use envsubst
to populate this file
For example
echo 'rest.advertised.host.name=$SCHEMA_REGISTRY_REST_ADVERTISTED_HOST_NAME' >> tmp.properties
export SCHEMA_REGISTRY_REST_ADVERTISTED_HOST_NAME=foobar
envsubst < tmp.properties > schema-registry.properties
...
cat schema-registry.properties | grep rest
rest.advertised.host.name=foobar
Upvotes: 1