Skip to content

Commit

Permalink
making rabbitmq password work as an env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
artntek committed Oct 30, 2023
1 parent ef217a1 commit aca0130
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
Binary file removed helm/charts/solr-6.2.3.tgz
Binary file not shown.
4 changes: 2 additions & 2 deletions helm/config/dataone-indexer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ index.document.root.directory={{ .Values.idxworker.document_directory }}
index.rabbitmq.hostname={{ .Values.rabbitmq.hostname }}
index.rabbitmq.hostport={{ .Values.rabbitmq.hostport }}
index.rabbitmq.username={{ .Values.rabbitmq.auth.username }}
## index.rabbitmq.password will be overwritten by nev var RABBITMQ_PASSWORD, if it exists
index.rabbitmq.password={{ .Values.rabbitmq.auth.password }}
## index.rabbitmq.password will be read from RABBITMQ_PASSWORD env var
index.rabbitmq.password: ${env:RABBITMQ_PASSWORD}
#If you change the number of the max priority, the existing queue must be deleted. And consumers must use the same number.
index.rabbitmq.max.priority=10

Expand Down
6 changes: 4 additions & 2 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ Create the name of the service account to use
{{/*
Get the rabbitmq password secret.
*/}}
{{- define "rabbitmq.secretPasswordName" -}}
{{- if .Values.rabbitmq.auth.existingPasswordSecret -}}
{{- define "idx.rabbitmq.secretPasswordName" -}}
{{- $rabbitmq := default dict .Values.rabbitmq -}}
{{- $auth := default dict $rabbitmq.auth -}}
{{- if $auth.existingPasswordSecret -}}
{{- printf "%s" (tpl .Values.rabbitmq.auth.existingPasswordSecret $) -}}
{{- else -}}
{{- printf "NEED_TO_SET_.Values.rabbitmq.auth.existingPasswordSecret_!!" -}}
Expand Down
6 changes: 1 addition & 5 deletions helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
# ports:
# - name: http
# containerPort: 80
# protocol: TCP
# livenessProbe:
# httpGet:
# path: /
Expand Down Expand Up @@ -69,7 +65,7 @@ spec:
- name: RABBITMQ_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "rabbitmq.secretPasswordName" . }}
name: {{ template "idx.rabbitmq.secretPasswordName" . }}
key: rabbitmq-password
optional: false
initContainers:
Expand Down
20 changes: 10 additions & 10 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ nameOverride: ""
fullnameOverride: ""

global:
storageClass: csi-rbd-sc
solrPort: &global-solr-port 8983
storageClass: csi-rbd-sc
solrPort: &global-solr-port 8983

serviceAccount:
# Specifies whether a service account should be created
Expand Down Expand Up @@ -116,8 +116,8 @@ rabbitmq:
hostname: d1index-rabbitmq-headless.d1index.svc
hostport: 5672
persistence:
storageClass: csi-rbd-sc
size: 10Gi
storageClass: csi-rbd-sc
size: 10Gi
#replicaCount: 3
#If you change the number of the max priority, the existing queue must be deleted. And consumers must use the same number.
#max.priority: 10
Expand All @@ -131,9 +131,9 @@ solr:
hostname: d1index-solr-headless.d1index.svc
service:
ports:
http: *global-solr-port
http: *global-solr-port
nodePorts:
http: *global-solr-port
http: *global-solr-port
containerPorts:
http: *global-solr-port
auth:
Expand Down Expand Up @@ -176,10 +176,10 @@ solr:
# - |
# curl --silent --connect-timeout 15000 --user ${SOLR_ADMIN_USERNAME}:${SOLR_ADMIN_PASSWORD} http://localhost:${SOLR_PORT_NUMBER}/api/node/health | grep --quiet '\"status\":\"OK\"'
lifecycleHooks:
postStart:
exec:
#command: ["/bin/bash", "-c", "env > /tmp/lifecycle-env"]
command: ["/bin/bash", "-c", "/solrconfig/config-solr.sh"]
postStart:
exec:
#command: ["/bin/bash", "-c", "env > /tmp/lifecycle-env"]
command: ["/bin/bash", "-c", "/solrconfig/config-solr.sh"]
#sidecars:
#- name: solr-cfg-sidecar
# image: ubuntu:22.04
Expand Down

0 comments on commit aca0130

Please sign in to comment.