apache / apache/solr-operator

Using a preexisting kubernetes.io/tls secret prevents creation of SolrCloud StatefulSet

Open
#440 1 comment 1 reaction 0 assignees View on GitHub
question
Dominant language
Go
Stars
283
Forks
148
PR merge metrics
No merged PRs in 30d

Description

Hello, I am fairly new to SolrCloud to please bear with me if anything here is obvious

I am trying to have my solrcloud use a preexisting TLS cert. I am following the documentation [here](https://apache.github.io/solr-operator/docs/solr-cloud/solr-cloud-crd.html#i-already-have-a-tls-certificate). The secret is known-good and contains `tls.crt` and `tls.key` values, but importantly does not already have a pkcs12 keystore. It appears that SolrCloud should handle this situation

However, when I set both the `keyStorePasswordSecret.name` and `pkcs12Secret.name` to the name of my kubernetes.io/tls secret, the solrcloud StatefulSet is never created, and I get the following error from Solr Operator

`2022-04-29T20:32:50.817Z ERROR controller-runtime.manager.controller.solrcloud Reconciler error {"reconciler group": "solr.apache.org", "reconciler kind": "SolrCloud", "name": "test4", "namespace": "redacted-test4", "error": "password-key key not found in password secret redacted"}`

I think this may have something to do with the fact that the `openssl pkcs12...` command in `initContainer` is never run? I'm unsure, any help is appreciated

Solr version: 8.11.1

UPDATE:

I was able to get it to create the StatefulSet by generating a pkcs12 secret and using it on both the certificate and `keyStorePasswordSecret.name`. Now the pod has a container 'gen-pkcs12-keystore` that is throwing the following error

`Can't open /var/solr/tls/ca.crt for reading, No such file or directory
140588678120768:error:02001002:system library:fopen:No such file or directory:../crypto/bio/bss_file.c:69:fopen('/var/solr/tls/ca.crt','r')
140588678120768:error:2006D080:BIO routines:BIO_new_file:no such file:../crypto/bio/bss_file.c:76:`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the SolrCloud configuration described in the issue, using a preexisting kubernetes.io/tls secret with tls.crt and tls.key but no PKCS#12 keystore. Trace the StatefulSet generation and the gen-pkcs12-keystore initContainer, then compare the password-secret and /var/solr/tls/ca.crt errors. Done means the documented TLS setup creates a working StatefulSet and pod.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
devops, search, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.