feat: Add init container for HA log management in deployment.yaml

This commit is contained in:
sha
2026-03-18 16:13:52 +02:00
parent 6414c5881e
commit 116a9ff29f
+13 -2
View File
@@ -25,8 +25,20 @@ spec:
hostNetwork: true hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet dnsPolicy: ClusterFirstWithHostNet
{{- end }} {{- end }}
{{- if or .Values.postgres.enabled .Values.haSecrets.enabled }}
initContainers: initContainers:
- name: init-config
image: busybox:latest
command:
- /bin/sh
- -c
- |
# Redirect HA log files to container stdout
ln -sf /proc/1/fd/1 /config/home-assistant.log
# Discard rotated logs
ln -sf /dev/null /config/home-assistant.log.1
volumeMounts:
- name: config
mountPath: /config
{{- if .Values.haSecrets.enabled }} {{- if .Values.haSecrets.enabled }}
- name: init-secrets - name: init-secrets
image: busybox:latest image: busybox:latest
@@ -77,7 +89,6 @@ spec:
- name: config - name: config
mountPath: /config mountPath: /config
{{- end }} {{- end }}
{{- end }}
containers: containers:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"