diff --git a/charts/nextjs/templates/web-env-cm.yaml b/charts/nextjs/templates/web-env-cm.yaml index 0800162..5fbbaeb 100644 --- a/charts/nextjs/templates/web-env-cm.yaml +++ b/charts/nextjs/templates/web-env-cm.yaml @@ -5,5 +5,13 @@ metadata: labels: {{- include "app.labels" . | nindent 4 }} data: - AWS_SDK_CONFIG_OPT_OUT: "true" - NEXT_TELEMETRY_DISABLED: "1" + {{- if .Values.web.envs }} + {{- range $index, $value := .Values.web.envs }} + {{ $index }}: {{ $value | toString | quote }} + {{- end }} + {{- end }} + {{- if .Values.web.extraEnvs }} + {{- range $index, $value := .Values.web.extraEnvs }} + {{ $index | upper | replace "-" "_" }}: {{ $value | toString | quote }} + {{- end }} + {{- end }} \ No newline at end of file diff --git a/charts/nextjs/templates/web-env-secret.yaml b/charts/nextjs/templates/web-env-secret.yaml index a393351..765a2e6 100644 --- a/charts/nextjs/templates/web-env-secret.yaml +++ b/charts/nextjs/templates/web-env-secret.yaml @@ -1,3 +1,4 @@ +{{- if .Values.web.extraSecretEnvs }} apiVersion: v1 kind: Secret metadata: @@ -5,8 +6,9 @@ metadata: labels: {{- include "app.labels" . | nindent 4 }} data: - {{- if .Values.web.extraEnvs }} - {{- range $index, $map := .Values.web.extraEnvs }} - {{ $map.name | upper | replace "-" "_" }}: {{ $map.value | toString | b64enc | quote }} + {{- if .Values.web.extraSecretEnvs }} + {{- range $index, $value := .Values.web.extraSecretEnvs }} + {{ $index | upper | replace "-" "_" }}: {{ $value | toString | b64enc | quote }} {{- end }} {{- end }} +{{- end }} diff --git a/charts/nextjs/values.yaml b/charts/nextjs/values.yaml index 2befa00..20f4eb6 100644 --- a/charts/nextjs/values.yaml +++ b/charts/nextjs/values.yaml @@ -129,20 +129,24 @@ web: tolerations: [] affinity: {} - extraEnvs: [] + envs: + AWS_SDK_CONFIG_OPT_OUT: "true" + NEXT_TELEMETRY_DISABLED: "1" + + extraEnvs: {} # extraEnvs: - # - name: AIRBROKE_GITHUB_ID - # value: "xxxx" - # - name: AIRBROKE_GITHUB_SECRET - # value: "xxxxx" - # - name: AIRBROKE_GITHUB_ORGS - # value: "xxxxx" - # - name: NEXTAUTH_SECRET - # value: "xxxxxxx" - # - name: NEXTAUTH_URL - # value: "https://xxxxxx" - # - name: AIRBROKE_OPENAI_API_KEY - # value: "sk-xxxxxxx" + # DEBUG_LEVEL: xxxx + # MY_COOL_VARIABLE: xxxx + + + extraSecretEnvs: + # extraSecretEnvs: + # AIRBROKE_GITHUB_ID: xxxx + # AIRBROKE_GITHUB_SECRET: xxxx + # AIRBROKE_GITHUB_ORGS: xxxx + # NEXTAUTH_SECRET: xxxx + # NEXTAUTH_URL: xxxx + # AIRBROKE_OPENAI_API_KEY: xxxx ## Pod Disruption Budget ## https://kubernetes.io/docs/tasks/run-application/configure-pdb/