diff --git a/charts/pogues/Chart.yaml b/charts/pogues/Chart.yaml index 754f5a3..11b79c1 100644 --- a/charts/pogues/Chart.yaml +++ b/charts/pogues/Chart.yaml @@ -9,5 +9,5 @@ dependencies: repository: https://charts.bitnami.com/bitnami type: application -version: 0.3.2 +version: 0.3.3 appVersion: "4.0.8" diff --git a/charts/pogues/templates/api/configmap.yaml b/charts/pogues/templates/api/configmap.yaml new file mode 100644 index 0000000..56aecb4 --- /dev/null +++ b/charts/pogues/templates/api/configmap.yaml @@ -0,0 +1,17 @@ +{{- if .Values.api.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "pogues.api.fullname" . }} + labels: + app: {{ template "pogues.api.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: +{{- if .Values.api.env }} +{{- range $key, $value := .Values.api.env }} + {{ $key }}: {{ $value | quote }} +{{- end -}} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/charts/pogues/templates/ui/configmap.yaml b/charts/pogues/templates/ui/configmap.yaml new file mode 100644 index 0000000..70895a3 --- /dev/null +++ b/charts/pogues/templates/ui/configmap.yaml @@ -0,0 +1,17 @@ +{{- if .Values.ui.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "pogues.ui.fullname" . }} + labels: + app: {{ template "pogues.ui.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: +{{- if .Values.ui.env }} +{{- range $key, $value := .Values.ui.env }} + {{ $key }}: {{ $value | quote }} +{{- end -}} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/charts/pogues/templates/ui/deployment.yaml b/charts/pogues/templates/ui/deployment.yaml index f94291e..29ef440 100644 --- a/charts/pogues/templates/ui/deployment.yaml +++ b/charts/pogues/templates/ui/deployment.yaml @@ -1,3 +1,4 @@ +{{- if .Values.ui.enabled -}} apiVersion: apps/v1 kind: Deployment metadata: @@ -13,10 +14,8 @@ spec: {{- include "pogues.ui.selectorLabels" . | nindent 6 }} template: metadata: - {{- with .Values.ui.podAnnotations }} annotations: - {{- toYaml . | nindent 8 }} - {{- end }} + checksum/config: {{ include (print $.Template.BasePath "/ui/configmap.yaml") labels: {{- include "pogues.ui.selectorLabels" . | nindent 8 }} spec: @@ -33,9 +32,11 @@ spec: {{- toYaml .Values.ui.securityContext | nindent 12 }} image: "{{ .Values.ui.image.repository }}:{{ .Values.ui.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.ui.image.pullPolicy }} - env: - - name: API_URL - value: {{ .Values.ui.env.API_URL | quote}} + {{- if and .Values.ui.enabled .Values.ui.env }} + envFrom: + - configMapRef: + name: {{ template "pogues.ui.fullname" . }} + {{- end }} ports: - name: http containerPort: 80 @@ -62,3 +63,4 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} +{{- end }} \ No newline at end of file