Skip to content

Commit

Permalink
adding solr credential sas secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
artntek committed Oct 31, 2023
1 parent aca0130 commit 7d609cc
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
4 changes: 4 additions & 0 deletions helm/config/dataone-indexer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ solr.index.uri=${solr.base.uri}/update/?commit=true
solr.schema.path=${solr.base.uri}/admin/file?file=schema.xml&contentType=text/xml;charset=utf-8
#solr.schema.path=./src/main/resources/index-solr-schema.xml

## TODO: Add Indexer code to use these credentials. Currently no auth
index.solr.username={{ .Values.solr.auth.username }}
index.solr.password=${env:SOLR_ADMIN_PASSWORD}

# The size of the thread pool which process the index task
index.thread.number={{ .Values.idxworker.pool_size }}

Expand Down
13 changes: 13 additions & 0 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,16 @@ Get the rabbitmq password secret.
{{- printf "NEED_TO_SET_.Values.rabbitmq.auth.existingPasswordSecret_!!" -}}
{{- end -}}
{{- end -}}

{{/*
Get the solr password secret.
*/}}
{{- define "idx.solr.secretPasswordName" -}}
{{- $solr := default dict .Values.solr -}}
{{- $solrauth := default dict $solr.auth -}}
{{- if $solrauth.existingSecret -}}
{{- printf "%s" (tpl .Values.solr.auth.existingSecret $) -}}
{{- else -}}
{{- printf "NEED_TO_SET_.Values.solr.auth.existingPasswordSecret_!!" -}}
{{- end -}}
{{- end -}}
6 changes: 6 additions & 0 deletions helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ spec:
name: {{ template "idx.rabbitmq.secretPasswordName" . }}
key: rabbitmq-password
optional: false
- name: SOLR_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "idx.solr.secretPasswordName" . }}
key: SOLR_ADMIN_PASSWORD
optional: false
initContainers:
- name: init-solr
image: busybox:latest
Expand Down
7 changes: 4 additions & 3 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,10 @@ solr:
containerPorts:
http: *global-solr-port
auth:
adminUsername: solradmin
adminPassword: change-to-using-a-solr-secret
#existingSecret: solr-secret
enabled: true
adminUsername: solrAdmin
existingSecret: ""
existingSecretPasswordKey: SOLR_ADMIN_PASSWORD
persistence:
storageClass: csi-rbd-sc
size: 10Gi
Expand Down

0 comments on commit 7d609cc

Please sign in to comment.