home-assistant

by joaquinito2051

Helm chartv0.9.1App 0.92.2

Home Assistant

About this chart

Home Assistant

This is a helm chart for Home Assistant

TL;DR;

$ helm install <helm-repo>/home-assistant

$ helm install stable/home-assistant

Introduction

This code is adopted for the official home assistant docker image

Installing the Chart

To install the chart with the release name my-release:

$ helm install --name my-release <helm-repo>/home-assistant

Uninstalling the Chart

$ helm install --name my-release stable/home-assistant

To uninstall/delete the my-release deployment:

$ helm delete my-release --purge

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following tables lists the configurable parameters of the Home Assistant chart and their default values.

ParameterDescriptionDefault
image.repositoryImage repositoryhomeassistant/home-assistant
image.tagImage tag. Possible values listed here.0.90.2
image.pullPolicyImage pull policyIfNotPresent
image.pullSecretsSecrets to use when pulling the image[]
strategyTypeSpecifies the strategy used to replace old Pods by new onesRecreate
service.typeKubernetes service type for the home-assistant GUIClusterIP
service.portKubernetes port where the home-assistant GUI is exposed8123
service.annotationsService annotations for the home-assistant GUI{}
service.clusterIPCluster IP for the home-assistant GUI``
service.externalIPsExternal IPs for the home-assistant GUI[]
service.loadBalancerIPLoadbalancer IP for the home-assistant GUI``
service.loadBalancerSourceRangesLoadbalancer client IP restriction range for the home-assistant GUI[]
hostNetworkEnable hostNetwork - might be needed for discovery to work false
service.nodePortnodePort to listen on for the home-assistant GUI``
ingress.enabledEnables Ingressfalse
ingress.annotationsIngress annotations{}
ingress.pathIngress path/
ingress.hostsIngress accepted hostnameschart-example.local
ingress.tlsIngress TLS configuration[]
persistence.enabledUse persistent volume to store datatrue
persistence.sizeSize of persistent volume claim5Gi
persistence.existingClaimUse an existing PVC to persist datanil
persistence.storageClassType of persistent volume claim-
persistence.accessModePersistence access modesReadWriteMany
git.enabledUse git-sync in init containerfalse
git.secretGit secret to use for git-syncgit-creds
git.syncPathGit sync path/config
git.keyPathGit ssh key path/root/.ssh
extraEnvExtra ENV vars to pass to the home-assistant container{}
extraEnvSecretsExtra env vars to pass to the home-assistant container from k8s secrets - see values.yaml for an example{}
configurator.enabledEnable the optional configuration UIfalse
configurator.image.repositoryImage repositorybillimek/hass-configurator-docker
configurator.image.tagImage tagx86_64-0.3.0
configurator.image.pullPolicyImage pull policyIfNotPresent
configurator.hassApiUrlHome Assistant API URL (e.g. 'http://home-assistant:8123/api/') - will auto-configure to proper URL if not set``
configurator.hassApiPasswordHome Assistant API Password``
configurator.basepathBase path of the home assistant configuration files/config
configurator.enforceBasepathIf set to true, will prevent navigation to other directories in the configurator UItrue
configurator.usernameIf this and password (below) are set, will require basic auth to access the configurator UI``
configurator.passwordIf this and username (above) are set, will require basic auth to access the configurator UI. password is in the format of a sha256 hash (e.g. "test" would be "{sha256}9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08")``
configurator.extraEnvExtra ENV vars to pass to the configuration UI{}
configurator.ingress.enabledEnables Ingress for the configurator UIfalse
configurator.ingress.annotationsIngress annotations for the configurator UI{}
configurator.ingress.hostsIngress accepted hostnames for the configurator UIchart-example.local
configurator.ingress.tlsIngress TLS configuration for the configurator UI[]
configurator.strategy.typehass-configurator Deployment Strategy type``
configurator.tolerationsToleration labels for pod assignment for the configurator UI[]
configurator.nodeSelectorNode labels for pod assignment for the configurator UI{}
configurator.schedulerNameUse an alternate scheduler, e.g. "stork" for the configurator UI``
configurator.podAnnotationsAffinity settings for pod assignment for the configurator UI{}
configurator.resourcesCPU/Memory resource requests/limits for the configurator UI{}
configurator.securityContextSecurity context to be added to hass-configurator pods for the configurator UI{}
configurator.service.typeKubernetes service type for the configurator UIClusterIP
configurator.service.portKubernetes port where the configurator UI is exposed3218
configurator.service.nodePortnodePort to listen on for the configurator UI``
configurator.service.annotationsService annotations for the configurator UI{}
configurator.service.labelsService labels to use for the configurator UI{}
configurator.service.clusterIPCluster IP for the configurator UI``
configurator.service.externalIPsExternal IPs for the configurator UI[]
configurator.service.loadBalancerIPLoadbalancer IP for the configurator UI``
configurator.service.loadBalancerSourceRangesLoadbalancer client IP restriction range for the configurator UI[]
vscode.enabledEnable the optional VS Code Server Sidecarfalse
vscode.image.repositoryImage repositorycodercom/code-server
vscode.image.tagImage tag1.939
vscode.image.pullPolicyImage pull policyIfNotPresent
vscode.hassConfigBase path of the home assistant configuration files/config
vscode.vscodePathBase path of the VS Code configuration files/config/.vscode
vscode.passwordIf this is set, will require a password to access the VS Code Server UI``
vscode.extraEnvExtra ENV vars to pass to the configuration UI{}
vscode.ingress.enabledEnables Ingress for the VS Code UIfalse
vscode.ingress.annotationsIngress annotations for the VS Code UI{}
vscode.ingress.hostsIngress accepted hostnames for the VS Code UIchart-example.local
vscode.ingress.tlsIngress TLS configuration for the VS Code UI[]
vscode.resourcesCPU/Memory resource requests/limits for the VS Code UI{}
vscode.securityContextSecurity context to be added to hass-vscode pods for the VS Code UI{}
vscode.service.typeKubernetes service type for the VS Code UIClusterIP
vscode.service.portKubernetes port where the vscode UI is exposed80
vscode.service.nodePortnodePort to listen on for the VS Code UI``
vscode.service.annotationsService annotations for the VS Code UI{}
vscode.service.labelsService labels to use for the VS Code UI{}
vscode.service.clusterIPCluster IP for the VS Code UI``
vscode.service.externalIPsExternal IPs for the VS Code UI[]
vscode.service.loadBalancerIPLoadbalancer IP for the VS Code UI``
vscode.service.loadBalancerSourceRangesLoadbalancer client IP restriction range for the VS Code UI[]
resourcesCPU/Memory resource requests/limits or the home-assistant GUI{}
nodeSelectorNode labels for pod assignment or the home-assistant GUI{}
tolerationsToleration labels for pod assignment or the home-assistant GUI[]
affinityAffinity settings for pod assignment or the home-assistant GUI{}

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
helm install --name my-release \
  --set configurator.hassApiPassword="$HASS_API_PASSWORD" \
    <helm-repo>/home-assistant
helm install --name my-release \

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,

helm install --name my-release -f values.yaml <helm-repo>/home-assistant

helm install --name my-release -f values.yaml stable/home-assistant Read through the values.yaml file. It has several commented out suggested values.

Configuring home assistant

Much of the home assistant configuration occurs inside the various files persisted to the /config directory. This will require external access to the persistent storage location where the home assistant configuration data is stored. Because this may be a limitation, there are two options built-in to this chart:

Configurator UI

Home Assistant Configurator UI is added as an optional sidecar container to Home Assistant with access to the home assistant configuration for easy in-browser editing and manipulation of Home Assistant.

VS Code Server

VS Code Server is added as an optional sidecar container to Home Assistant with access to the home assistant configuration for easy in-browser editing and manipulation of Home Assistant. If using this, it is possible to manually install the Home Assistant Config Helper Extension in order to have a deeper integration with Home Assistant within VS Code while editing the configuration files.

Git sync secret

In order to sync the home assistant from a git repo, you have to store a ssh key as a kubernetes git secret

kubectl create secret generic git-creds --from-file=id_rsa=git/k8s_id_rsa --from-file=known_hosts=git/known_hosts --from-file=id_rsa.pub=git/k8s_id_rsa.pub

Deploy home-assistant with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has home-assistant on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the charthome-assistant is pinned at v0.9.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply