Skip to content

Commit

Permalink
Merge pull request #42 from small-hack/add-timezone-env-var-plus-extr…
Browse files Browse the repository at this point in the history
…a-env

add `homeAssistant.timezone` env var for the home assistant container and allow `extraEnv` to also be added to the home assistant container
  • Loading branch information
jessebot authored Jun 11, 2024
2 parents c3e3a23 + 124acf2 commit 933aaae
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 7 deletions.
2 changes: 1 addition & 1 deletion charts/home-assistant/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.11.1
version: 0.12.0

# The appVersion is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Home Assistant versions can be found here: https://github.com/home-assistant/core/releases
Expand Down
8 changes: 5 additions & 3 deletions charts/home-assistant/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# home-assistant

![Version: 0.11.1](https://img.shields.io/badge/Version-0.11.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2024.6.1](https://img.shields.io/badge/AppVersion-2024.6.1-informational?style=flat-square)
![Version: 0.12.0](https://img.shields.io/badge/Version-0.12.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2024.6.1](https://img.shields.io/badge/AppVersion-2024.6.1-informational?style=flat-square)

A Helm chart for home assistant on Kubernetes

Expand All @@ -14,11 +14,12 @@ A Helm chart for home assistant on Kubernetes

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| affinity | object | `{}` | affinity to have the home assisant pod attracted to a specific node |
| autoscaling.enabled | bool | `false` | |
| autoscaling.maxReplicas | int | `100` | |
| autoscaling.minReplicas | int | `1` | |
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
| extraEnv | list | `[]` | extra environment variables to pass to the home assistant container, see: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/#define-an-environment-variable-for-a-container |
| extraVolumeMounts | list | `[]` | Additional volumeMounts on the output Deployment definition. example device mount: - mountPath: /dev/ttyACM0 name: usb |
| extraVolumes | list | `[]` | Additional volumes on the output Deployment definition. example device as volume: - hostPath: path: >- /dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20230509111242-if00 type: CharDevice name: usb |
| fullnameOverride | string | `""` | fullname override to use for all chart resources, instead of helm release name |
Expand All @@ -40,6 +41,7 @@ A Helm chart for home assistant on Kubernetes
| homeAssistant.setupHacsJobs | object | `{"enabled":false}` | hacs is the [home assistant community store](https://hacs.xyz/) |
| homeAssistant.setupHacsJobs.enabled | bool | `false` | enable the hacs setup job, requires persistence to be on |
| homeAssistant.themes | string | `""` | contents of themes.yaml file to create, ignored if homeAssistant.existingThemesConfigMap set |
| homeAssistant.timezone | string | `""` | The timezone to use for this container. Use one of the identifers here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List |
| image.pullPolicy | string | `"IfNotPresent"` | image pullPolicy. If using tag: latest, set image.pullPolicy: Always |
| image.repository | string | `"ghcr.io/home-assistant/home-assistant"` | image repository that defaults to the official Home Assistant GitHub ghcr.io repo |
| image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. |
Expand Down Expand Up @@ -78,7 +80,7 @@ A Helm chart for home assistant on Kubernetes
| serviceAccount.automount | bool | `true` | Automatically mount a ServiceAccount's API credentials? |
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created |
| serviceAccount.name | string | `""` | If not set and create is true, a name is generated using the fullname template |
| tolerations | list | `[]` | |
| tolerations | list | `[]` | tolerations to have the home assisant pod tolerate node taints |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
22 changes: 19 additions & 3 deletions charts/home-assistant/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "home-assistant.serviceAccountName" . }}
{{- with .Values.securityContext }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if and (or .Values.homeAssistant.configuration .Values.homeAssistant.existingConfigurationConfigMap) .Values.persistence.enabled }}
initContainers:
- name: config-creation
Expand Down Expand Up @@ -63,14 +65,26 @@ spec:
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{- with .Values.securityContext }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- toYaml . | nindent 12 }}
{{- end }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.targetPort }}
protocol: TCP
{{- if or .Values.homeAssistant.timezone .Values.extraEnv }}
env:
{{- with .Values.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.homeAssistant.timezone }}
- name: TZ
value: {{ .Values.homeAssistant.timezone }}
{{- end }}{{/* end with timezone env var */}}
{{- end }}{{/* end check for env vars for home asisstant container */}}
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
Expand All @@ -79,8 +93,10 @@ spec:
readinessProbe:
{{- toYaml .Values.readinessProbe | nindent 12 }}
{{- end }}
{{- with .Values.resources }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if or .Values.persistence.enabled .Values.extraVolumeMounts }}
volumeMounts:
{{- if .Values.persistence.enabled }}
Expand Down
9 changes: 9 additions & 0 deletions charts/home-assistant/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,22 @@ extraVolumes: []
# name: usb
extraVolumeMounts: []

# -- extra environment variables to pass to the home assistant container, see:
# https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/#define-an-environment-variable-for-a-container
extraEnv: []

nodeSelector: {}

# -- tolerations to have the home assisant pod tolerate node taints
tolerations: []

# -- affinity to have the home assisant pod attracted to a specific node
affinity: {}

homeAssistant:
# -- The timezone to use for this container. Use one of the identifers here:
# https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
timezone: ""
# -- hacs is the [home assistant community store](https://hacs.xyz/)
setupHacsJobs:
# -- enable the hacs setup job, requires persistence to be on
Expand Down

0 comments on commit 933aaae

Please sign in to comment.