Files
kubernetes/home-assistant/kustomization.yaml
Dustin C. Hatch 94b7168b1e home-assistant: Add restart MQTTMarionette script
There's obviously a bug or something in `mqttmarionette` because it
occasionally gets "stuck" in a state where it is running but does
not reconnect to the MQTT broker.  In such situations, it has to be
restarted (and even then it doesn't shut down correctly but has to
be killed with SIGKILL, usually).  I have been doing this manually, but
with this shell script and a corresponding "shell command" integration
in Home Assistant, it can be done automatically.  This is similar to
how Home Assistant restarts Mopidy on the living room stereo when it
gets into the same kind of state.
2024-08-23 09:24:46 -05:00

118 lines
3.0 KiB
YAML

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: home-assistant
labels:
- pairs:
app.kubernetes.io/instance: home-assistant
resources:
- namespace.yaml
- secrets.yaml
- postgres-cert.yaml
- home-assistant.yaml
- mosquitto-cert.yaml
- mosquitto.yaml
- zigbee2mqtt.yaml
- zwavejs2mqtt.yaml
- piper.yaml
- whisper.yaml
- ingress.yaml
- ../dch-root-ca
configMapGenerator:
- name: home-assistant
files:
- configuration.yaml
- event-snapshot.sh
- groups.yaml
- restart-diddy-mopidy.sh
- restart-kitchen-mqttmarionette.sh
- shell-command.yaml
- ssh_known_hosts
- rest-command.yaml
options:
disableNameSuffixHash: true
labels:
app.kubernetes.io/name: home-assistant
app.kubernetes.io/component: home-assistant
app.kubernetes.io/part-of: home-assistant
- name: mosquitto
files:
- mosquitto.conf
- name: zigbee2mqtt
envs:
- zigbee2mqtt.env
patches:
- patch: |-
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: home-assistant
spec:
template:
spec:
initContainers:
- name: waitfordb
image: docker.io/library/postgres:15
command:
- sh
- -c
- until pg_isready; do sleep 1; done
env: &pgsqlenv
- name: PGHOST
value: postgresql.pyrocufflink.blue
- name: PGGDATABASE
value: homeassistant
- name: PGUSER
value: homeassistant
- name: PGSSLMODE
value: verify-full
- name: PGSSLROOTCERT
value: /run/dch-ca/dch-root-ca.crt
- name: PGSSLCERT
value: /run/secrets/home-assistant/postgresql/tls.crt
- name: PGSSLKEY
value: /run/secrets/home-assistant/postgresql/tls.key
volumeMounts:
- mountPath: /run/dch-ca/
name: dch-root-ca
readOnly: true
- mountPath: /run/secrets/home-assistant/postgresql
name: postgresql-cert
containers:
- name: home-assistant
env: *pgsqlenv
volumeMounts:
- mountPath: /run/config
name: home-assistant-config
readOnly: true
- mountPath: /run/dch-ca/
name: dch-root-ca
readOnly: true
- mountPath: /run/secrets/home-assistant
name: home-assistant-secrets
readOnly: true
- mountPath: /run/secrets/home-assistant/postgresql
name: postgresql-cert
volumes:
- name: home-assistant-config
configMap:
name: home-assistant
defaultMode: 0600
- name: home-assistant-secrets
secret:
secretName: home-assistant
defaultMode: 0640
- name: postgresql-cert
secret:
secretName: postgres-client-cert
defaultMode: 0640
- name: dch-root-ca
configMap:
name: dch-root-ca