Operator should be able to present a client certificate to make API calls to mTLS enabled SolrClouds #256
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.
The most expedient approach is to supply a client cert and key via a TLS secret to the operator during deployment to use to identify itself to Solr pods with mTLS enabled. Additionally, if the Certificate Authority (CA) for the Solr certs is not inherently trusted, users may also need to supply the CA’s cert PEM to the operator via another secret.
With this approach, either the client cert used by the operator or the CA’s cert must be in the truststore used by the Solr pods. Just trusting the CA cert is the most flexible, but also implies any client cert signed by that CA will be accepted by Solr, so may be too open for some users.
However, this means all Solr clusters managed by the same operator instance need to trust the client cert used by the operator. In other words, there’s only 1 client cert used by an operator instance. Feels a bit cumbersome to try to support many different certs, but perhaps that can be a future enhancement?
Here’s a script to set up the certs and a custom CA for testing mTLS. Save this script in a directory named
solr-mTLSand run it (it will create several sub-directories holding various cert related files):Here are the notable config settings you need to make this work.
Operator Helm chart settings (referenced secrets created in script above ^^):
SolrCloud CRD YAML (secrets created in script above ^^):
Once you deploy Solr with
solrTLSenabled, you can test using curl (after creating a port-forward to a Solr pod) from thesolr-mTLSdirectory using: