apache / solr-operator

Official Kubernetes operator for Apache Solr
https://solr.apache.org/operator
Apache License 2.0
243 stars 112 forks source link

The SolrPrometheusExporter should detect whether to use a basicAuth secret #654

Open HoustonPutman opened 7 months ago

HoustonPutman commented 7 months ago

Currently in the PrometheusExporter spec, you must specify a basicAuthSecret if you have BasicAuth enabled on a solrCloud.

The operator should be able to detect if the SolrCloud is setup to use BasicAuth, and figure out the secret it is using if the use does not provide an explicit basicAuthSecret. This should work very similarly to how the zkConnection info and solrImage are also taken from the SolrCloud reference, if none are provided.

Docs: https://apache.github.io/solr-operator/docs/solr-prometheus-exporter/#prometheus-exporter-with-basic-auth

radu-gheorghe commented 6 months ago

I've fiddled with this enough to think that I understand the use-case. It sounds like we have two paths: 1) The user bootstapped basic auth. In this case, we need to point the exporter to the default auth secret (-solrcloud-basic-auth). 2) The user provided their own security.json and auth secret. In which case that secret will be in the SoldCloud object definition, so we should simply get it from there and re-use it in the exporter.

Am I on the right path?

HoustonPutman commented 4 months ago

Sorry, I missed this. But yes, you are on the right path!