mirror of
https://github.com/shadoll/helm-charts.git
synced 2026-08-28 03:27:08 +00:00
feat: Add init container for HA log management in deployment.yaml
This commit is contained in:
@@ -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 }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user