diff --git a/helm/config/dataone-indexer.properties b/helm/config/dataone-indexer.properties index fabd737f..9d655609 100644 --- a/helm/config/dataone-indexer.properties +++ b/helm/config/dataone-indexer.properties @@ -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 }} diff --git a/helm/templates/_helpers.tpl b/helm/templates/_helpers.tpl index 25a8fc06..b6993133 100644 --- a/helm/templates/_helpers.tpl +++ b/helm/templates/_helpers.tpl @@ -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 -}} diff --git a/helm/templates/deployment.yaml b/helm/templates/deployment.yaml index 8a1ad4e5..687b23d6 100644 --- a/helm/templates/deployment.yaml +++ b/helm/templates/deployment.yaml @@ -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 diff --git a/helm/values.yaml b/helm/values.yaml index 8d0402ba..644ed828 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -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