Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't remove KAFKA_PROPERTIES_FILE; allow user to use mounted file #502

Merged
merged 8 commits into from
Apr 7, 2023

Conversation

brsolomon-deloitte
Copy link
Contributor

This change gives users the option to put their own KAFKA_PROPERTIES_FILE into an image without specifying KAFKA_PROPERTIES.

This is particularly useful in cases where a user does not want to store KAFKA_PROPERTIES in version control such as Git. (Even though it is base64-encoded, it is not encrypted.)

This change gives users the option to put their _own_ `KAFKA_PROPERTIES_FILE` into an image _without_ specifying `KAFKA_PROPERTIES`.

This is particularly useful in cases where a user does not want to store `KAFKA_PROPERTIES` in version control such as Git. (Even though it is base64-encoded, it is not encrypted.)
Copy link
Collaborator

@Bert-R Bert-R left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good addition!
Can you update the README.md and add an alternative docker run where the Kafka properties file is mounted in read-only?

Something like this:

docker run -d --rm -p 9000:9000 \
    -v $(pwd)/kafka.properties:/tmp/kafka.properties:ro \
    -e KAFKA_BROKERCONNECT=<host:port,host:port> \
    -e KAFKA_PROPERTIES_FILE=/tmp/kafka.properties \
    -e KAFKA_TRUSTSTORE="$(cat kafka.truststore.jks | base64)" \   # optional
    -e KAFKA_KEYSTORE="$(cat kafka.keystore.jks | base64)" \       # optional
    obsidiandynamics/kafdrop

src/main/docker/kafdrop.sh Outdated Show resolved Hide resolved
@brsolomon-deloitte brsolomon-deloitte changed the title touch, don't rm, KAFKA_PROPERTIES_FILE Don't remove KAFKA_PROPERTIES_FILE; allow user to use mounted file Apr 7, 2023
@brsolomon-deloitte
Copy link
Contributor Author

Can you update the README.md and add an alternative docker run where the Kafka properties file is mounted in read-only?

Added.

src/main/docker/kafdrop.sh Outdated Show resolved Hide resolved
src/main/docker/kafdrop.sh Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Co-authored-by: Bert Roos <[email protected]>
Copy link
Collaborator

@Bert-R Bert-R left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks!

@Bert-R Bert-R merged commit d563606 into obsidiandynamics:master Apr 7, 2023
Bert-R added a commit that referenced this pull request Oct 28, 2023
Earlier, we used to delete the following files if existing:
* kafka.properties
* kafka.truststore.jks
* kafka.keystore.jks

Since #502, we are creating them if not existing. With this commit, we take
the middle ground: let the user decide about the existence.
Bert-R added a commit that referenced this pull request Oct 30, 2023
Earlier, we used to delete the following files if existing:
* kafka.properties
* kafka.truststore.jks
* kafka.keystore.jks

Since #502, we are creating them if not existing. With this commit, we take
the middle ground: let the user decide about the existence.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants