4.8 KiB
Home Assistant Helm Chart — Issues & Improvements
Defaults & Best Practices
-
hostNetwork: trueshould default tofalsehostNetworkis only needed for HomeKit/mDNS discovery on the LAN. A clean install should not claim the host network by default. Users who need it can opt in via values. File:values.yamlline 12,deployment.yamllines 24-27 -
HomeKit should default to disabled HomeKit is a specific integration, not a core feature. Default
homekit.enabled: falseand let users enable it when needed. Currently exposes port 21063 on every install. File:values.yamllines 16-18,deployment.yamllines 105-109 -
Timezone should default to
UTCCurrently hardcoded toEurope/Kyiv. Chart defaults should be locale-neutral. Users override via values for their deployment. File:values.yamlline 14 -
Resource limits too high for default CPU limit of 8 cores is excessive for a default install. Consider
cpu: 2/memory: 2Gias default limits, withcpu: 100m/memory: 256Mias requests. Production users can increase as needed. File:values.yamllines 40-46 -
imagePullPolicy: Alwaysshould beIfNotPresentFor tagged images (notlatest),IfNotPresentis the Kubernetes convention.Alwayscauses unnecessary image pulls on every pod restart. File:values.yamlline 5,deployment.yamlline 93
Security
-
No
securityContextdefined The deployment has no pod or container security context. Should add at minimum:securityContext: runAsNonRoot: false # HA needs root for s6 init # But container-level: allowPrivilegeEscalation: false capabilities: drop: [ALL] add: [NET_BIND_SERVICE] # if needed for homekitNote: Home Assistant uses s6-overlay which requires root. Full non-root may not be feasible, but
capabilitiesshould still be restricted. File:deployment.yaml -
No
ServiceAccountcreated Chart should create a dedicated ServiceAccount withautomountServiceAccountToken: false(HA doesn't need Kubernetes API access). This follows the principle of least privilege. Files: newtemplates/serviceaccount.yaml,deployment.yaml
Reliability
- No liveness/readiness probes
HA exposes HTTP on port 8123. The chart should define probes:
livenessProbe: httpGet: path: / port: 8123 initialDelaySeconds: 60 periodSeconds: 30 failureThreshold: 5 readinessProbe: httpGet: path: / port: 8123 initialDelaySeconds: 30 periodSeconds: 10initialDelaySecondsshould be generous — HA can take 30-90s to start depending on integrations. Consider making these configurable via values. File:deployment.yaml
Code Quality
-
busybox:latestin init containers Init containers (init-config,init-secrets,init-recorder) usebusybox:latestwhich is unpinned and not reproducible. Pin to a specific version, e.g.busybox:1.37and make it configurable via values. File:deployment.yamllines 31, 43, 63 -
version-sourceannotation in deployment template Theversion-source: github-release:home-assistant/coreannotation is for thejust appCLI tooling in the k3s repo, not a chart concern. Should be removed from the template and added via HelmRelease annotations or values. File:deployment.yamllines 8-9
Future Enhancements
-
Auto-generate
http.yamlfrom chart values Same pattern as the recorder init container — generate/config/http.yamland addhttp: !include http.yamltoconfiguration.yaml. This simplifies initial setup sincetrusted_proxiesis required for Traefik/ingress to work and the values can be derived from the Kubernetes environment. Generated file example:server_port: 8123 use_x_forwarded_for: true trusted_proxies: - 10.42.0.0/16 # k8s pod CIDR (Traefik) - 10.43.0.0/16 # k8s service CIDRValues structure:
http: enabled: false port: 8123 useXForwardedFor: true trustedProxies: [] # - 10.42.0.0/16 # - 10.43.0.0/16File:
values.yaml,deployment.yaml(new init container) -
S3 backup support Add optional S3 sync as a post-backup step in the CronJob. Write locally to PVC first (fast restore), then push to S3 for disaster recovery. Values structure:
backup: s3: enabled: false endpoint: "" bucket: "" existingSecret: "" -
NOTES.txt for post-install instructions Add
templates/NOTES.txtto display useful info after install (URLs, first-time setup steps, how to access HA). -
Support
topologySpreadConstraintsFor multi-node clusters, allow configuring topology spread via values (though HA is typically single-replica).