From da4fbbd2929b1af22a443b6fbd90d48160de8b0b Mon Sep 17 00:00:00 2001 From: Ivan Krutov Date: Fri, 28 Jan 2022 17:51:35 +0300 Subject: [PATCH 1/2] Ability to pass environment variables to Moon pod containers (fixes #94) --- moon/templates/deployment.yaml | 21 +++++++++++++++++++++ moon/values.yaml | 16 ++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/moon/templates/deployment.yaml b/moon/templates/deployment.yaml index 410e015..88f719c 100644 --- a/moon/templates/deployment.yaml +++ b/moon/templates/deployment.yaml @@ -123,6 +123,13 @@ spec: {{- else }} - -disable-memory-limits {{- end }} + {{- if .Values.moon.env }} + env: + {{- range $key, $value := .Values.moon.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + {{- end }} {{- if .Values.moon.enabled.resources }} {{- if .Values.moon.resources }} resources: @@ -168,6 +175,13 @@ spec: {{- end }} {{- if .Values.moon.enabled.resources }} {{- if .Values.moon.api }} + {{- if .Values.moon.api.env }} + env: + {{- range $key, $value := .Values.moon.api.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + {{- end }} {{- if .Values.moon.api.resources }} resources: {{ toYaml .Values.moon.api.resources | indent 10 }} @@ -211,6 +225,13 @@ spec: {{- end }} {{- if .Values.moon.enabled.resources }} {{- if .Values.moon.ui }} + {{- if .Values.moon.ui.env }} + env: + {{- range $key, $value := .Values.moon.ui.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + {{- end }} {{- if .Values.moon.ui.resources }} resources: {{ toYaml .Values.moon.ui.resources | indent 10 }} diff --git a/moon/values.yaml b/moon/values.yaml index 48c14cb..2e032d2 100644 --- a/moon/values.yaml +++ b/moon/values.yaml @@ -90,6 +90,11 @@ moon: # ## # replicas: 2 +# ## +# ## Environment variables passed to moon container. +# ## +# env: {} + ## ## Resources assigned to moon container. ## @@ -139,6 +144,12 @@ moon: requests: cpu: "0.05" memory: 64Mi + +# ## +# ## Environment variables passed to moon-api container. +# ## +# env: {} + # ## # ## Override moon-api image # ## @@ -160,6 +171,11 @@ moon: requests: cpu: "0.05" memory: 64Mi +# ## +# ## Environment variables passed to moon-ui container. +# ## +# env: {} + # ## # ## Override moon-ui image # ## From 689964c230f2d04e58e9f902d4c758a2596d9727 Mon Sep 17 00:00:00 2001 From: Ivan Krutov Date: Fri, 28 Jan 2022 18:27:16 +0300 Subject: [PATCH 2/2] Ability to pass environment variables to Moon pod containers (fixes #94) --- moon/templates/deployment.yaml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/moon/templates/deployment.yaml b/moon/templates/deployment.yaml index 88f719c..a1b642a 100644 --- a/moon/templates/deployment.yaml +++ b/moon/templates/deployment.yaml @@ -125,10 +125,10 @@ spec: {{- end }} {{- if .Values.moon.env }} env: - {{- range $key, $value := .Values.moon.env }} - - name: {{ $key }} - value: {{ $value | quote }} - {{- end }} + {{- range $key, $value := .Values.moon.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} {{- end }} {{- if .Values.moon.enabled.resources }} {{- if .Values.moon.resources }} @@ -177,10 +177,10 @@ spec: {{- if .Values.moon.api }} {{- if .Values.moon.api.env }} env: - {{- range $key, $value := .Values.moon.api.env }} - - name: {{ $key }} - value: {{ $value | quote }} - {{- end }} + {{- range $key, $value := .Values.moon.api.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} {{- end }} {{- if .Values.moon.api.resources }} resources: @@ -227,10 +227,10 @@ spec: {{- if .Values.moon.ui }} {{- if .Values.moon.ui.env }} env: - {{- range $key, $value := .Values.moon.ui.env }} - - name: {{ $key }} - value: {{ $value | quote }} - {{- end }} + {{- range $key, $value := .Values.moon.ui.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} {{- end }} {{- if .Values.moon.ui.resources }} resources: