@@ -143,6 +143,12 @@ spec:
143
143
fieldRef :
144
144
apiVersion : v1
145
145
fieldPath : metadata.name
146
+ {{- if .Values.usePasswordFiles }}
147
+ - name : SOLR_SSL_KEY_STORE_PASSWORD_FILE
148
+ value : " /opt/bitnami/solr/secrets/tls/keystore-password"
149
+ - name : SOLR_SSL_TRUST_STORE_PASSWORD_FILE
150
+ value : " /opt/bitnami/solr/secrets/tls/truststore-password"
151
+ {{- else }}
146
152
- name : SOLR_SSL_KEY_STORE_PASSWORD
147
153
valueFrom :
148
154
secretKeyRef :
@@ -153,6 +159,7 @@ spec:
153
159
secretKeyRef :
154
160
name : {{ include "solr.tlsPasswordsSecret" . }}
155
161
key : truststore-password
162
+ {{- end }}
156
163
{{- if .Values.tls.resources }}
157
164
resources : {{- toYaml .Values.tls.resources | nindent 12 }}
158
165
{{- else if ne .Values.tls.resourcesPreset "none" }}
@@ -170,6 +177,10 @@ spec:
170
177
- name : empty-dir
171
178
mountPath : /tmp
172
179
subPath : tmp-dir
180
+ {{- if .Values.usePasswordFiles }}
181
+ - name : solr-secrets
182
+ mountPath : /opt/bitnami/solr/secrets
183
+ {{- end }}
173
184
{{- end }}
174
185
{{- if .Values.initContainers }}
175
186
{{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }}
@@ -230,12 +241,17 @@ spec:
230
241
{{- if .Values.auth.enabled }}
231
242
- name : SOLR_ADMIN_USERNAME
232
243
value : {{ .Values.auth.adminUsername | quote }}
244
+ {{- if .Values.usePasswordFiles }}
245
+ - name : SOLR_ADMIN_PASSWORD_FILE
246
+ value : {{ printf "/opt/bitnami/solr/secrets/pass/%s" (include "solr.secretPasswordKey" .) }}
247
+ {{- else }}
233
248
- name : SOLR_ADMIN_PASSWORD
234
249
valueFrom :
235
250
secretKeyRef :
236
251
name : {{ include "solr.secretName" . }}
237
252
key : {{ include "solr.secretPasswordKey" . }}
238
253
{{- end }}
254
+ {{- end }}
239
255
- name : SOLR_ZK_HOSTS
240
256
value : {{ include "solr.zookeeper.hosts" . | quote }}
241
257
{{- if .Values.tls.enabled }}
@@ -249,18 +265,25 @@ spec:
249
265
{{- end }}
250
266
- name : SOLR_SSL_KEY_STORE
251
267
value : /opt/bitnami/solr/certs/keystore.p12
268
+ - name : SOLR_SSL_TRUST_STORE
269
+ value : /opt/bitnami/solr/certs/truststore.p12
270
+ {{- if .Values.usePasswordFiles }}
271
+ - name : SOLR_SSL_KEY_STORE_PASSWORD_FILE
272
+ value : " /opt/bitnami/solr/secrets/tls/keystore-password"
273
+ - name : SOLR_SSL_TRUST_STORE_PASSWORD_FILE
274
+ value : " /opt/bitnami/solr/secrets/tls/truststore-password"
275
+ {{- else }}
252
276
- name : SOLR_SSL_KEY_STORE_PASSWORD
253
277
valueFrom :
254
278
secretKeyRef :
255
279
name : {{ include "solr.tlsPasswordsSecret" . }}
256
280
key : keystore-password
257
- - name : SOLR_SSL_TRUST_STORE
258
- value : /opt/bitnami/solr/certs/truststore.p12
259
281
- name : SOLR_SSL_TRUST_STORE_PASSWORD
260
282
valueFrom :
261
283
secretKeyRef :
262
284
name : {{ include "solr.tlsPasswordsSecret" . }}
263
285
key : truststore-password
286
+ {{- end }}
264
287
- name : SOLR_SSL_CHECK_PEER_NAME
265
288
value : " false"
266
289
{{- end }}
@@ -296,6 +319,9 @@ spec:
296
319
- /bin/bash
297
320
- -ec
298
321
- |
322
+ {{- if and .Values.usePasswordFiles .Values.auth.enabled }}
323
+ export SOLR_ADMIN_PASSWORD="$(< $SOLR_ADMIN_PASSWORD_FILE)"
324
+ {{- end }}
299
325
curl --silent --connect-timeout 15000 {{ ternary "--user ${SOLR_ADMIN_USERNAME}:${SOLR_ADMIN_PASSWORD}" "" .Values.auth.enabled }} http://localhost:${SOLR_PORT_NUMBER}/solr/admin/info/system | grep --quiet '\"status\":0'
300
326
{{- end }}
301
327
{{- if .Values.customReadinessProbe }}
@@ -307,6 +333,9 @@ spec:
307
333
- /bin/bash
308
334
- -ec
309
335
- |
336
+ {{- if and .Values.usePasswordFiles .Values.auth.enabled }}
337
+ export SOLR_ADMIN_PASSWORD="$(< $SOLR_ADMIN_PASSWORD_FILE)"
338
+ {{- end }}
310
339
curl --silent --connect-timeout 15000 {{ ternary "--user ${SOLR_ADMIN_USERNAME}:${SOLR_ADMIN_PASSWORD}" "" .Values.auth.enabled }} http://localhost:${SOLR_PORT_NUMBER}/api/node/health | grep --quiet '\"status\":\"OK\"'
311
340
{{- end }}
312
341
{{- if .Values.customStartupProbe }}
@@ -318,6 +347,9 @@ spec:
318
347
- /bin/bash
319
348
- -ec
320
349
- |
350
+ {{- if and .Values.usePasswordFiles .Values.auth.enabled }}
351
+ export SOLR_ADMIN_PASSWORD="$(< $SOLR_ADMIN_PASSWORD_FILE)"
352
+ {{- end }}
321
353
curl --silent --connect-timeout 15000 {{ ternary "--user ${SOLR_ADMIN_USERNAME}:${SOLR_ADMIN_PASSWORD}" "" .Values.auth.enabled }} http://localhost:${SOLR_PORT_NUMBER}/api/node/health | grep --quiet '\"status\":\"OK\"'
322
354
{{- end }}
323
355
{{- end }}
@@ -340,6 +372,14 @@ spec:
340
372
- name : scripts
341
373
mountPath : /scripts/setup.sh
342
374
subPath : setup.sh
375
+ {{- if and .Values.usePasswordFiles .Values.auth.enabled }}
376
+ - name : solr-pass-secret
377
+ mountPath : /opt/bitnami/solr/secrets/pass
378
+ {{- end }}
379
+ {{- if and .Values.usePasswordFiles .Values.tls.enabled }}
380
+ - name : solr-tls-secret
381
+ mountPath : /opt/bitnami/solr/secrets/tls
382
+ {{- end }}
343
383
- name : data
344
384
mountPath : {{ .Values.persistence.mountPath }}
345
385
{{- if .Values.persistence.subPath }}
@@ -365,6 +405,16 @@ spec:
365
405
configMap :
366
406
name : {{ printf "%s-scripts" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
367
407
defaultMode : 0755
408
+ {{- if and .Values.usePasswordFiles .Values.auth.enabled }}
409
+ - name : solr-pass-secret
410
+ secret :
411
+ secretName : {{ include "solr.secretName" . }}
412
+ {{- end }}
413
+ {{- if and .Values.usePasswordFiles .Values.tls.enabled }}
414
+ - name : solr-tls-secret
415
+ secret :
416
+ secretName : {{ include "solr.tlsPasswordsSecret" . }}
417
+ {{- end }}
368
418
{{- if and .Values.persistence.enabled .Values.persistence.existingClaim }}
369
419
- name : data
370
420
persistentVolumeClaim :
0 commit comments