Seed HA's HTTP config store instead of the http YAML block

Since 2026.10 HA imports an http: block only as an unconfirmed trial and
reverts it after 5 minutes, which breaks access through the ingress (400).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-18 14:17:24 +02:00
co-authored by Claude Opus 5.5
parent 9f8ce47986
commit a9b62a514b
4 changed files with 39 additions and 23 deletions
+11 -13
View File
@@ -4,7 +4,7 @@ Helm chart for [Home Assistant](https://www.home-assistant.io/) (container insta
single-node cluster (`loki`), deployed by ArgoCD via the `apps-in-apps` repo into the single-node cluster (`loki`), deployed by ArgoCD via the `apps-in-apps` repo into the
namespace `homeassistant`. namespace `homeassistant`.
URL: https://homeassistant.smokyzone.de:30444 (LAN / Tailscale only; the DNS record URL: https://homeassistant.smokyzone.de (LAN / Tailscale only; the DNS record
points at the node's private IP `192.168.2.218`). Certificate from points at the node's private IP `192.168.2.218`). Certificate from
`letsencrypt-dns-cloudflare` (DNS-01). `letsencrypt-dns-cloudflare` (DNS-01).
@@ -16,16 +16,14 @@ points at the node's private IP `192.168.2.218`). Certificate from
discovery. discovery.
- **Config** lives on the `local-path` PVC `homeassistant-config` (`/config`), which is kept - **Config** lives on the `local-path` PVC `homeassistant-config` (`/config`), which is kept
when the app is deleted. Back it up (users, integrations, history are in there). when the app is deleted. Back it up (users, integrations, history are in there).
- **configuration.yaml** is seeded once by an init container (see `seedConfiguration` in - **Reverse proxy**: since 2026.10 HA keeps its HTTP settings in `/config/.storage/http`
`values.yaml`), including the reverse-proxy block: (managed in the UI under *Settings → System → Network*). An `http:` block in
`configuration.yaml` is only imported once as an unconfirmed trial and silently reverted
```yaml after 5 minutes (then HA answers `400 Bad Request` through the ingress). The init
http: container therefore seeds that store on first start with
use_x_forwarded_for: true `use_x_forwarded_for: true` and `trustedProxies` from `values.yaml` (pod network
trusted_proxies: [10.1.0.0/16, 127.0.0.1] `10.1.0.0/16`). An existing store is never overwritten.
``` - **configuration.yaml** is seeded once (`seedConfiguration`). After the first start the
Without it HA answers `400 Bad Request` through the ingress. After the first start the
file is yours; the chart never overwrites it. Edit it with file is yours; the chart never overwrites it. Edit it with
`kubectl -n homeassistant exec -it deploy/homeassistant -- vi /config/configuration.yaml` `kubectl -n homeassistant exec -it deploy/homeassistant -- vi /config/configuration.yaml`
and restart the pod (or *Developer tools → YAML → Restart* in the UI). and restart the pod (or *Developer tools → YAML → Restart* in the UI).
@@ -36,10 +34,10 @@ points at the node's private IP `192.168.2.218`). Certificate from
## First start ## First start
1. Open https://homeassistant.smokyzone.de:30444 and create the owner account during 1. Open https://homeassistant.smokyzone.de and create the owner account during
onboarding (first visitor becomes the owner, so do this right away). onboarding (first visitor becomes the owner, so do this right away).
2. Home location / units / language (Deutsch) in the onboarding wizard. 2. Home location / units / language (Deutsch) in the onboarding wizard.
3. Companion app: server URL `https://homeassistant.smokyzone.de:30444` (works at home and 3. Companion app: server URL `https://homeassistant.smokyzone.de` (works at home and
via Tailscale). via Tailscale).
## Upgrades ## Upgrades
+12
View File
@@ -7,3 +7,15 @@ metadata:
data: data:
configuration.yaml: | configuration.yaml: |
{{- .Values.seedConfiguration | nindent 4 }} {{- .Values.seedConfiguration | nindent 4 }}
# Format of HA's HTTP config store (homeassistant/components/http/config.py).
http.json: |
{{- dict "version" 2 "minor_version" 2 "key" "http" "data" (dict
"stable" (dict "server_port" (int .Values.port) "use_x_forwarded_for" true
"trusted_proxies" .Values.trustedProxies
"cors_allowed_origins" (list "https://cast.home-assistant.io")
"login_attempts_threshold" -1 "ip_ban_enabled" true
"ssl_profile" "modern" "use_x_frame_options" true
"created_at" "2026-10-18T00:00:00+00:00"
"error" nil "error_message" nil)
"pending" nil
"yaml_migration_done" true) | toPrettyJson | nindent 4 }}
+6 -1
View File
@@ -21,7 +21,7 @@ spec:
# Keep cluster DNS (service names) working with hostNetwork. # Keep cluster DNS (service names) working with hostNetwork.
dnsPolicy: {{ ternary "ClusterFirstWithHostNet" "ClusterFirst" .Values.hostNetwork }} dnsPolicy: {{ ternary "ClusterFirstWithHostNet" "ClusterFirst" .Values.hostNetwork }}
initContainers: initContainers:
# Seed configuration.yaml (incl. reverse-proxy settings) on first start only. # Seed configuration.yaml and the HTTP (reverse proxy) store on first start only.
- name: seed-config - name: seed-config
image: busybox:1.36 image: busybox:1.36
command: command:
@@ -33,6 +33,11 @@ spec:
cp /seed/configuration.yaml /config/configuration.yaml cp /seed/configuration.yaml /config/configuration.yaml
echo "seeded configuration.yaml" echo "seeded configuration.yaml"
fi fi
if [ ! -f /config/.storage/http ]; then
mkdir -p /config/.storage
cp /seed/http.json /config/.storage/http
echo "seeded .storage/http (reverse proxy)"
fi
# Files included by the seeded configuration.yaml (same defaults as HA's onboarding). # Files included by the seeded configuration.yaml (same defaults as HA's onboarding).
[ -f /config/automations.yaml ] || echo "[]" > /config/automations.yaml [ -f /config/automations.yaml ] || echo "[]" > /config/automations.yaml
touch /config/scripts.yaml /config/scenes.yaml touch /config/scripts.yaml /config/scenes.yaml
+10 -9
View File
@@ -18,20 +18,21 @@ persistence:
size: 5Gi size: 5Gi
storageClassName: "" storageClassName: ""
# Lets HA accept requests from ingress-nginx (pod network 10.1.0.0/16); without it HA
# answers 400 Bad Request to proxied requests. Since 2026.10 HA keeps the HTTP settings
# in /config/.storage/http (UI-managed); an `http:` block in configuration.yaml is only
# imported as an unconfirmed trial and reverted after 5 minutes. So the chart seeds the
# store directly - on first start only, never overwriting an existing one.
trustedProxies:
- 10.1.0.0/16
- 127.0.0.1/32
# Written to /config/configuration.yaml on first start only (when the file does not # Written to /config/configuration.yaml on first start only (when the file does not
# exist yet). Afterwards the file belongs to you; the chart never overwrites it. # exist yet). Afterwards the file belongs to you; the chart never overwrites it.
# The http block lets HA accept requests from ingress-nginx (pod network 10.1.0.0/16);
# without it HA answers 400 Bad Request to proxied requests.
seedConfiguration: | seedConfiguration: |
# Loads the default set of integrations. Do not remove. # Loads the default set of integrations. Do not remove.
default_config: default_config:
http:
use_x_forwarded_for: true
trusted_proxies:
- 10.1.0.0/16
- 127.0.0.1
frontend: frontend:
themes: !include_dir_merge_named themes themes: !include_dir_merge_named themes
@@ -42,7 +43,7 @@ seedConfiguration: |
ingress: ingress:
enabled: true enabled: true
className: nginx className: nginx
# ingress-nginx is NodePort-only: https://homeassistant.smokyzone.de:30444 # https://homeassistant.smokyzone.de (ingress-nginx hostPort 443; NodePort :30444 also works)
host: homeassistant.smokyzone.de host: homeassistant.smokyzone.de
clusterIssuer: letsencrypt-dns-cloudflare clusterIssuer: letsencrypt-dns-cloudflare
annotations: annotations: