From baad4254e47e0729b730f2746e0ebd28de5c3d9f Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Mon, 17 May 2021 18:03:51 +0500 Subject: [PATCH] Allow specifying environment variables for chia --- charts/chia/1.1.0/ix_values.yaml | 3 --- charts/chia/1.1.0/questions.yaml | 23 +++++++++++++++++++++ charts/chia/1.1.0/templates/deployment.yaml | 4 +++- charts/chia/1.1.0/test_values.yaml | 3 --- 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/charts/chia/1.1.0/ix_values.yaml b/charts/chia/1.1.0/ix_values.yaml index 1cbd7c5739..0c663f6714 100644 --- a/charts/chia/1.1.0/ix_values.yaml +++ b/charts/chia/1.1.0/ix_values.yaml @@ -3,6 +3,3 @@ image: tag: 1.1.4 pullPolicy: IfNotPresent updateStrategy: Recreate -environmentVariables: - - name: "keys" - value: "/plots/keyfile" diff --git a/charts/chia/1.1.0/questions.yaml b/charts/chia/1.1.0/questions.yaml index 30fd657aeb..1a56f3d2cb 100644 --- a/charts/chia/1.1.0/questions.yaml +++ b/charts/chia/1.1.0/questions.yaml @@ -1,6 +1,8 @@ groups: - name: "Storage" description: "Configure Storage for Chia" + - name: "Chia Environment Variables" + description: "Set the environment that will be visible to the container" questions: - variable: appVolumeMounts @@ -104,3 +106,24 @@ questions: schema: type: hostpath required: true + + - variable: environmentVariables + label: "Environment Variables for Chia" + group: "Chia Environment Variables" + schema: + type: list + default: [] + items: + - variable: environmentVariable + label: "Environment Variable" + schema: + type: dict + attrs: + - variable: name + label: "Name" + schema: + type: string + - variable: value + label: "Value" + schema: + type: string diff --git a/charts/chia/1.1.0/templates/deployment.yaml b/charts/chia/1.1.0/templates/deployment.yaml index e47a45386b..7b3147b199 100644 --- a/charts/chia/1.1.0/templates/deployment.yaml +++ b/charts/chia/1.1.0/templates/deployment.yaml @@ -28,7 +28,9 @@ spec: protocol: TCP containerPort: 8444 hostPort: 8444 -{{ include "common.containers.allEnvironmentVariables" .Values | nindent 10 }} + {{ $envList := (default list .Values.environmentVariables) }} + {{ $envList = mustAppend $envList (dict "name" "keys" "value" "/plots/keyfile") }} + {{ include "common.containers.allEnvironmentVariables" (dict "environmentVariables" $envList) | nindent 10 }} volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }} {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }} - name: extrappvolume-{{ $index }} diff --git a/charts/chia/1.1.0/test_values.yaml b/charts/chia/1.1.0/test_values.yaml index ed048e39f3..b2fd50d602 100644 --- a/charts/chia/1.1.0/test_values.yaml +++ b/charts/chia/1.1.0/test_values.yaml @@ -3,9 +3,6 @@ image: tag: 1.1.4 pullPolicy: IfNotPresent updateStrategy: Recreate -environmentVariables: - - name: "keys" - value: "/plots/keyfile" appVolumeMounts: staging: