Skip to content

Commit

Permalink
use template to render projected env vars in pods
Browse files Browse the repository at this point in the history
  • Loading branch information
alxgomz committed Oct 19, 2023
1 parent 1e73c3f commit 1786cbf
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,15 @@ spec :
imagePullPolicy: {{ index $.Values "liveIndexing" (printf "%s" $serviceName) "image" "pullPolicy" }}
{{- include "alfresco-common.component-security-context" .Values | indent 8 }}
envFrom:
- secretRef:
name: {{ default (printf "%s-messagebroker-secret" (include "alfresco-search-enterprise.fullname" $)) $.Values.messageBroker.existingSecret.name }}
- configMapRef:
name: {{ template "alfresco-search-enterprise.fullname" $ }}-es
env:
{{- include "alfresco-search-enterprise.activemq.secret.env" $ | nindent 12 }}
{{- include "alfresco-search-enterprise.activemq.cm.env" $ | nindent 12 }}
{{- include "alfresco-common.spring.activemq.env" . | nindent 12 }}
{{- include "alfresco-search-enterprise.config.spring.envCredentials" $ | nindent 12 }}
{{- include "alfresco-search-enterprise.env" $ | nindent 12 }}
{{- range $key, $val := $.Values.liveIndexing.environment }}
{{- $atsCtx := dict "Values" (dict "nameOverride" (printf "%s-%s" ($.Values.nameOverride | default $.Chart.Name) "ats")) "Chart" $.Chart "Release" $.Release }}
{{- $ats_cm := coalesce $.Values.ats.existingConfigMap.name (include "alfresco-search-enterprise.fullname" $atsCtx) }}
- name: ALFRESCO_ACCEPTEDCONTENTMEDIATYPESCACHE_BASEURL
Expand All @@ -54,10 +57,6 @@ spec :
configMapKeyRef:
name: {{ $ats_cm }}
key: {{ $.Values.ats.existingConfigMap.keys.sfs_url }}
{{- include "alfresco-common.spring.activemq.env" . | nindent 12 }}
{{- include "alfresco-search-enterprise.config.spring.envCredentials" $ | nindent 12 }}
{{- include "alfresco-search-enterprise.env" $ | nindent 12 }}
{{- range $key, $val := $.Values.liveIndexing.environment }}
- name: {{ $key }}
value: {{ $val | quote }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ spec:
envFrom:
- configMapRef:
name: {{ template "alfresco-search-enterprise.fullname" . }}-es
- secretRef:
name: {{ default (printf "%s-messagebroker-secret" (include "alfresco-search-enterprise.fullname" .)) .Values.messageBroker.existingSecret.name }}
env:
{{- $dbCtx := dict "Values" (dict "nameOverride" "alfresco-database") "Chart" .Chart "Release" .Release }}
{{- $dbFullName := (include "alfresco-search-enterprise.fullname" $dbCtx) }}
{{- $ats_cm := .Values.ats.existingConfigMap.name | default (printf "%s-ats" (include "alfresco-search-enterprise.fullname" .)) }}
{{- include "alfresco-search-enterprise.activemq.secret.env" . | nindent 12 }}
{{- include "alfresco-search-enterprise.activemq.cm.env" . | nindent 12 }}
{{- include "alfresco-common.spring.activemq.env" . | nindent 12 }}
{{- include "alfresco-search-enterprise.config.spring.envCredentials" . | nindent 12 }}
- name: ALFRESCO_ACCEPTEDCONTENTMEDIATYPESCACHE_BASEURL
valueFrom:
configMapKeyRef:
Expand Down Expand Up @@ -66,9 +68,6 @@ spec:
configMapKeyRef:
name: {{ .Values.reindexing.db.existingConfigMap.name | default $dbFullName }}
key: {{ .Values.reindexing.db.existingConfigMap.keys.url }}
{{- include "alfresco-search-enterprise.activemq.cm.env" $ | nindent 12 }}
{{- include "alfresco-common.spring.activemq.env" . | nindent 12 }}
{{- include "alfresco-search-enterprise.config.spring.envCredentials" $ | nindent 12 }}
ports:
- name: http
containerPort: 8080
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ template "alfresco-search-enterprise.fullname" . }}-messagebroker-secret
{{- $ctx := dict "Values" (dict "nameOverride" (printf "%s-%s" ($.Values.nameOverride | default $.Chart.Name) "mq")) "Chart" $.Chart "Release" $.Release }}
name: {{ template "alfresco-search-enterprise.fullname" $ctx }}
labels:
{{- include "alfresco-search-enterprise.labels" $ | nindent 4 }}
{{- include "alfresco-search-enterprise.labels" . | nindent 4 }}
type: Opaque
data:
{{- if .Values.activemq.enabled }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,18 @@ spec:
imagePullPolicy: {{ .image.pullPolicy }}
{{- end }}
{{- include "alfresco-common.component-security-context" .Values | indent 8 }}
envFrom:
- secretRef:
name: {{ default (printf "%s-messagebroker-secret" (include "alfresco-search-enterprise.fullname" .)) .Values.messageBroker.existingSecret.name }}
env:
{{- include "alfresco-search-enterprise.activemq.cm.env" $ | nindent 12 }}
{{- include "alfresco-search-enterprise.activemq.secret.env" . | nindent 12 }}
{{- include "alfresco-search-enterprise.activemq.cm.env" . | nindent 12 }}
{{- include "alfresco-common.spring.activemq.env" . | nindent 12 }}
{{- include "alfresco-search-enterprise.env" . | nindent 12 }}
{{- $atsCtx := dict "Values" (dict "nameOverride" (printf "%s-%s" ($.Values.nameOverride | default $.Chart.Name) "ats")) "Chart" $.Chart "Release" $.Release }}
{{- $ats_cm := coalesce .Values.ats.existingConfigMap.name (include "alfresco-search-enterprise.fullname" $atsCtx) }}
- name: ALFRESCO_ACCEPTEDCONTENTMEDIATYPESCACHE_BASEURL
valueFrom:
configMapKeyRef:
name: {{ $ats_cm }}
key: {{ .Values.ats.existingConfigMap.keys.transform_url }}
{{- include "alfresco-common.spring.activemq.env" . | nindent 12 }}
{{- include "alfresco-search-enterprise.env" . | nindent 12 }}
{{- range $key, $val := .Values.liveIndexing.environment }}
- name: {{ $key }}
value: {{ $val | quote }}
Expand Down

0 comments on commit 1786cbf

Please sign in to comment.