Evict Home Assistant from k8s-edge (read meter via MQTT, drop privileged) #85

Merged
k.renner merged 1 commits from worktree-ha-meter-mqtt-bridge into master 2026-06-27 21:08:09 +00:00
Owner

Phase 4 — move the heavy HA pod off edge

The end goal of this epic. HA (8Gi limit, privileged, ~10k entities) was pinned to k8s-edge only for the USB power meter it read via edl21. That's now replaced by the sml2mqtt bridge (#83/#84) publishing to Mosquitto, so HA:

  • drops nodeSelector: zone=edge + the workload-class=pinned toleration → schedules on the general cluster pool, off the soon-to-be-tiny edge box;
  • drops the /dev/stromzaehler USB hostPath mount + volume (the bridge owns the device);
  • drops securityContext.privileged — the USB device was its only justification.

Also fixes the bridge bring-up

After EDL21 was deleted in HA, the running HA process still held the meter's serial fd open (pod never restarted), so the bridge got "readable but no data (multiple access)". This change recreates HA without the device → fd released → bridge gets exclusive access to the meter.

Expected brief gap

Meter data in HA resumes once the MQTT sensors land in the homeassistant repo (next step), reusing the existing sensor.smart_meter_* entity_ids so Energy-dashboard history is continuous.

After merge I will

  1. Confirm HA is Running on a CP node (not edge) and the bridge reads clean SML → publishes to sml2mqtt/#.
  2. Capture the device-id/OBIS/units and add the HA mqtt: sensors.

kubectl kustomize kubernetes/apps/home-assistant builds clean; no stromzaehler/zone: edge/privileged config remains in the HA deployment.

Generated with Claude Code

## Phase 4 — move the heavy HA pod off edge The end goal of this epic. HA (8Gi limit, privileged, ~10k entities) was pinned to k8s-edge **only** for the USB power meter it read via `edl21`. That's now replaced by the `sml2mqtt` bridge (#83/#84) publishing to Mosquitto, so HA: - **drops** `nodeSelector: zone=edge` + the `workload-class=pinned` toleration → schedules on the general cluster pool, off the soon-to-be-tiny edge box; - **drops** the `/dev/stromzaehler` USB hostPath mount + volume (the bridge owns the device); - **drops** `securityContext.privileged` — the USB device was its only justification. ### Also fixes the bridge bring-up After EDL21 was deleted in HA, the running HA **process still held the meter's serial fd open** (pod never restarted), so the bridge got *"readable but no data (multiple access)"*. This change recreates HA **without** the device → fd released → bridge gets exclusive access to the meter. ### Expected brief gap Meter data in HA resumes once the MQTT sensors land in the `homeassistant` repo (next step), reusing the existing `sensor.smart_meter_*` entity_ids so Energy-dashboard history is continuous. ### After merge I will 1. Confirm HA is Running on a CP node (not edge) and the bridge reads clean SML → publishes to `sml2mqtt/#`. 2. Capture the device-id/OBIS/units and add the HA `mqtt:` sensors. `kubectl kustomize kubernetes/apps/home-assistant` builds clean; no `stromzaehler`/`zone: edge`/`privileged` config remains in the HA deployment. Generated with Claude Code
k.renner added 1 commit 2026-06-27 21:07:55 +00:00
Home Assistant was pinned to k8s-edge solely for the USB power meter it
read via edl21. edl21 is now replaced by the sml2mqtt bridge (publishes to
Mosquitto), so HA:
- drops nodeSelector zone=edge + the workload-class=pinned toleration →
  the heavy 8Gi pod schedules on the general cluster pool, off the
  soon-to-be-tiny edge box;
- drops the /dev/stromzaehler USB hostPath mount + volume (bridge owns the
  device now);
- drops securityContext.privileged — the USB device was its only
  justification.

This also frees the serial fd the running HA process still held after
edl21's removal (HA recreates without the device), giving the sml2mqtt
bridge exclusive access to the meter.

Meter data in HA resumes once the MQTT sensors (reusing the old
sensor.smart_meter_* entity_ids for history continuity) land in the
homeassistant repo — brief expected gap.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
k.renner merged commit 6600db98f6 into master 2026-06-27 21:08:09 +00:00
Sign in to join this conversation.