From 351d46296f4f98642a65569e11f3b3f0156fe2b1 Mon Sep 17 00:00:00 2001 From: Aleksey Sviridkin Date: Mon, 7 Dec 2020 18:54:56 +0300 Subject: [PATCH] [home-assistant] Fix env for appdaemon (#305) --- charts/home-assistant/Chart.yaml | 2 +- charts/home-assistant/README.md | 7 +++--- .../home-assistant/templates/deployment.yaml | 11 +++++---- charts/home-assistant/values.yaml | 24 +++++++++++++++---- 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/charts/home-assistant/Chart.yaml b/charts/home-assistant/Chart.yaml index 144aa2ab..e7bed976 100644 --- a/charts/home-assistant/Chart.yaml +++ b/charts/home-assistant/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: 0.118.3 description: Home Assistant name: home-assistant -version: 3.2.0 +version: 3.2.1 keywords: - home-assistant - hass diff --git a/charts/home-assistant/README.md b/charts/home-assistant/README.md index 8cb50d83..50b834b0 100644 --- a/charts/home-assistant/README.md +++ b/charts/home-assistant/README.md @@ -42,7 +42,7 @@ The command removes all the Kubernetes components associated with the chart and The following tables lists the configurable parameters of the Home Assistant chart and their default values. | Parameter | Description | Default | -|-------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------| +| ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | | `image.repository` | Image repository | `homeassistant/home-assistant` | | `image.tag` | Image tag. Possible values listed [here](https://hub.docker.com/r/homeassistant/home-assistant/tags/). | `0.118.3` | | `image.pullPolicy` | Image pull policy | `IfNotPresent` | @@ -142,7 +142,7 @@ The following tables lists the configurable parameters of the Home Assistant cha | `vscode.vscodePath` | Base path of the VS Code configuration files | `/config/.vscode` | | `vscode.password` | If this is set, will require a password to access the VS Code Server UI | `` | | `vscode.extraEnv` | Extra ENV vars to pass to the configuration UI | `{}` | -| `vscode.args` | Optional arguments to pass into vscode image. Defaulting to "-" uses default arguments. | `-` | +| `vscode.args` | Optional arguments to pass into vscode image. Defaulting to "-" uses default arguments. | `-` | | `vscode.ingress.enabled` | Enables Ingress for the VS Code UI | `false` | | `vscode.ingress.annotations` | Ingress annotations for the VS Code UI | `{}` | | `vscode.ingress.hosts` | Ingress accepted hostnames for the VS Code UI | `chart-example.local` | @@ -163,7 +163,8 @@ The following tables lists the configurable parameters of the Home Assistant cha | `appdaemon.image.tag` | Image tag | `3.0.5` | | `appdaemon.image.pullPolicy` | Image pull policy | `IfNotPresent` | | `appdaemon.haToken` | Home Assistant API token - you need to generate it in your Home Assistant profile and then copy here | `` | -| `appdaemon.extraEnv` | Extra ENV vars to pass to the AppDaemon container | `{}` | +| `appdaemon.env` | Extra ENV vars to pass to the AppDaemon container | `{}` | +| `appdaemon.envFrom` | Extra ENV vars from configMap or secret to pass to the AppDaemon container | `{}` | | `appdaemon.configSubPath` | An optional subPath for the AppDaemon container's config volume mount | `appdaemon` | | `appdaemon.ingress.enabled` | Enables Ingress for the AppDaemon UI | `false` | | `appdaemon.ingress.annotations` | Ingress annotations for the AppDaemon UI | `{}` | diff --git a/charts/home-assistant/templates/deployment.yaml b/charts/home-assistant/templates/deployment.yaml index 0dea79a6..d7463993 100644 --- a/charts/home-assistant/templates/deployment.yaml +++ b/charts/home-assistant/templates/deployment.yaml @@ -338,7 +338,14 @@ spec: - name: appdaemon containerPort: {{ .Values.appdaemon.service.port }} protocol: TCP + {{- with .Values.appdaemon.envFrom }} + envFrom: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.appdaemon.env }} env: + {{- toYaml . | nindent 12 }} + {{- end }} - name: HA_URL value: "http://localhost:{{ .Values.service.port }}" {{- if .Values.appdaemon.ingress.enabled }} @@ -365,10 +372,6 @@ spec: - name: GIT_COMMITTER_EMAIL value: {{ .Values.git.user.email }} {{ end }} - {{- range $key, $value := .Values.vscode.extraEnv }} - - name: {{ $key }} - value: {{ $value | quote }} - {{- end }} volumeMounts: - mountPath: /ha-conf name: config diff --git a/charts/home-assistant/values.yaml b/charts/home-assistant/values.yaml index a6d7edd6..621bc4e8 100644 --- a/charts/home-assistant/values.yaml +++ b/charts/home-assistant/values.yaml @@ -313,10 +313,26 @@ appdaemon: ## Home Assistant API token # haToken: - ## Additional hass-vscode container environment variable - ## For instance to add a http_proxy - ## - extraEnv: {} + # Environment variables to be passed to appdaemon comtainer + env: [] + # - name: SOME_VAR + # value: some-var-value + # - name: SOME_VAR_FROM_CONFIG_MAP + # valueFrom: + # configMapRef: + # name: configmap-name + # key: config-key + # - name: SOME_SECRET + # valueFrom: + # secretKeyRef: + # name: secret-name + # key: secret-key + + envFrom: [] + # - configMapRef: + # name: config-map-name + # - secretRef: + # name: secret-name # If you use an existingClaim for the config volume then it is sometimes useful to specify a subPath # within the volume to mount instead of mounting the root.