Allow cassandra to be configured via config map on K8s #129
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We use cassandra images on K8s and need some additional configuration changes in cassandra.yaml file.
It is standard approach on K8s to use config map for this purpose which has all the configuration settings and being mounted into the pod.
But in case when docker-entrypoint.sh changes cassandra.yaml during startup replacing some values with the environment variables mounting cannot be used.
The idea is to use the mounted file as a template and let docker-entrypoint.sh to change the copy of the original configuration stored in CASSANDRA_CONFIG_TEMPLATE_FOLDER/cassandra.yaml. When CASSANDRA_CONFIG_TEMPLATE_FOLDER is not set, script uses the old behavior and modifies configuration directly.
So I can share original configuration to multiple containers: