h-a: Add init container to wait for PostgreSQL
When Home Assistant starts, if PostgreSQL is unavailable, it will come up successfully, but without the history component. It never tries again to connect and enable the component. This makes it difficult to detect the problem and thus easy to overlook the missing functionality. To avoid having extended periods of missing state history, we'll force Home Assistant to wait for PostgreSQL to come up before starting.dch-webhooks-secrets
parent
50beecf0a9
commit
832dea2c7d
|
@ -47,6 +47,28 @@ patches:
|
|||
spec:
|
||||
template:
|
||||
spec:
|
||||
initContainers:
|
||||
- name: waitfordb
|
||||
image: docker.io/library/postgres:15
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- until pg_isready; do sleep 1; done
|
||||
env:
|
||||
- name: PGHOST
|
||||
value: default.postgresql
|
||||
- name: PGGDATABASE
|
||||
value: homeassistant
|
||||
- name: PGUSER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: home-assistant.homeassistant.default.credentials.postgresql.acid.zalan.do
|
||||
key: username
|
||||
- name: PGPASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: home-assistant.homeassistant.default.credentials.postgresql.acid.zalan.do
|
||||
key: password
|
||||
containers:
|
||||
- name: home-assistant
|
||||
env:
|
||||
|
|
Loading…
Reference in New Issue