Skip to content

Commit

Permalink
[monica] Revert "Move mysql env vars to deployment"
Browse files Browse the repository at this point in the history
This reverts commit a8e7f6a.
  • Loading branch information
wissamataleh committed Sep 12, 2021
1 parent a8e7f6a commit d49a2a9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
8 changes: 8 additions & 0 deletions charts/monica/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,11 @@ Create the name for the MySQL service to use.
{{- define "monica.mysql.fullname" -}}
{{- printf "%s-%s" .Release.Name "mysql" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Define MySQL host and port env vars.
*/}}
{{- define "monica.mysql.env" -}}
DB_HOST: {{- include "monica.mysql.fullname" . }}
DB_PORT: {{ 3306 | quote }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/monica/templates/configmap-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ data:
{{- range $envKey, $envVal := .Values.env }}
{{ $envKey | upper }}: {{ $envVal | quote }}
{{- end }}
{{- if .Values.mysql.enabled }}
{{- include "monica.mysql.env" . | nindent 2 }}
{{- end }}
7 changes: 0 additions & 7 deletions charts/monica/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.mysql.enabled }}
env:
- name: DB_HOST
value: {{- include "monica.mysql.fullname" . }}
- name: DB_PORT
value: {{ 3306 | quote }}
{{- end }}
envFrom:
- configMapRef:
name: {{ include "monica.fullname" . }}-env
Expand Down

0 comments on commit d49a2a9

Please sign in to comment.