Skip to content

Add config options to enable TLS from cert files mounted to a dir on each pod by a cert-manager extension - #292

Merged
thelabdude merged 19 commits into
apache:mainfrom
thelabdude:issue-291-mounted-tls-dir
Aug 3, 2021
Merged

thelabdude merged 19 commits into
apache:mainfrom
thelabdude:issue-291-mounted-tls-dir

Conversation

@thelabdude

@thelabdude thelabdude commented Jul 20, 2021 •

Copy link
Copy Markdown
Contributor

Fixes #291

The tricky part of this PR is the keystore password being in a file, but Solr (and the exporter) have no facility for loading the password from a file (Solr expects the SOLR_SSL_KEY_STORE_PASSWORD ENV VAR via the EnvSSLCredentialProvider) and the prometheus exporter expects these to come through the javax.net.ssl.keyStorePassword and javax.net.ssl.trustStorePassword Java system props ...

So for the main Solr pod, I'm leveraging the initdb support in the Docker Solr framework to run a script in /docker-entrypoint-initdb.d to export the SOLR_SSL_KEY_STORE_PASSWORD and SOLR_SSL_TRUST_STORE_PASSWORD env vars by cat'ing out the password file(s) in the mounted dir. That's a bit onerous but the real rub is with the exporter, where it doesn't even work with the SOLR_SSL_KEY_STORE_PASSWORD and SOLR_SSL_TRUST_STORE_PASSWORD env vars and expects the Java system properties. So had to resort to wrapping the entrypoint script to add these properties from the password file at runtime.

Added basic unit tests to verify the config and reconcile around these new config options

@thelabdude
thelabdude marked this pull request as draft July 20, 2021 19:05
Comment thread controllers/solrprometheusexporter_controller.go Outdated

@HoustonPutman HoustonPutman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Small comments, looks good so far though!

Awaiting some wonderful additions to the TLS tests 😅

Comment thread controllers/util/solr_util.go Outdated
Comment thread controllers/util/solr_util.go
Comment thread api/v1beta1/solrcloud_types.go Outdated
@thelabdude
thelabdude marked this pull request as ready for review July 30, 2021 18:25

@HoustonPutman HoustonPutman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good to go!

@thelabdude
thelabdude merged commit eb56afc into apache:main Aug 3, 2021
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.

Config options to enable TLS from files in a mounted directory instead of from a secret

2 participants