2021-02-10 10:09:33 +00:00
|
|
|
image:
|
2021-12-03 12:02:44 +00:00
|
|
|
repository: tccr.io/truecharts/home-assistant
|
2021-02-10 10:09:33 +00:00
|
|
|
pullPolicy: IfNotPresent
|
2023-10-22 16:38:36 +00:00
|
|
|
tag: v2023.10.5@sha256:7f6015340e975746cc3c007252b888e59cb6644ba2f51db1178203949825454a
|
2021-05-19 13:12:45 +00:00
|
|
|
service:
|
2021-03-03 15:51:25 +00:00
|
|
|
main:
|
2021-05-19 13:12:45 +00:00
|
|
|
ports:
|
|
|
|
main:
|
|
|
|
port: 8123
|
2021-11-06 21:55:18 +00:00
|
|
|
targetPort: 8123
|
2023-04-11 10:07:17 +00:00
|
|
|
workload:
|
|
|
|
main:
|
|
|
|
podSpec:
|
|
|
|
initContainers:
|
|
|
|
init:
|
|
|
|
type: init
|
|
|
|
enabled: true
|
|
|
|
imageSelector: image
|
2023-04-12 21:41:02 +00:00
|
|
|
command: /config/init/init.sh
|
2021-10-13 10:02:40 +00:00
|
|
|
|
2021-02-10 10:09:33 +00:00
|
|
|
# # Enable devices to be discoverable
|
|
|
|
# hostNetwork: true
|
|
|
|
|
|
|
|
# # When hostNetwork is true set dnsPolicy to ClusterFirstWithHostNet
|
|
|
|
# dnsPolicy: ClusterFirstWithHostNet
|
2022-12-29 22:25:28 +00:00
|
|
|
homeassistant:
|
|
|
|
trusted_proxies: []
|
2021-02-10 10:09:33 +00:00
|
|
|
# Enable a prometheus-operator servicemonitor
|
|
|
|
prometheus:
|
|
|
|
serviceMonitor:
|
|
|
|
enabled: false
|
|
|
|
# interval: 1m
|
|
|
|
# additionalLabels: {}
|
|
|
|
persistence:
|
|
|
|
config:
|
2021-04-13 19:43:27 +00:00
|
|
|
enabled: true
|
2023-04-11 10:07:17 +00:00
|
|
|
mountPath: /config
|
|
|
|
targetSelectAll: true
|
2022-06-07 17:41:19 +00:00
|
|
|
init:
|
2023-04-11 10:07:17 +00:00
|
|
|
enabled: true
|
|
|
|
type: configmap
|
|
|
|
objectName: init
|
2022-06-07 17:41:19 +00:00
|
|
|
mountPath: "/config/init"
|
2023-04-11 10:07:17 +00:00
|
|
|
defaultMode: "0777"
|
2022-06-07 17:41:19 +00:00
|
|
|
readOnly: true
|
2023-04-11 10:07:17 +00:00
|
|
|
targetSelector:
|
|
|
|
main:
|
|
|
|
init: {}
|
2022-06-07 17:41:19 +00:00
|
|
|
|
|
|
|
configmap:
|
|
|
|
init:
|
|
|
|
enabled: true
|
|
|
|
data:
|
|
|
|
init.sh: |-
|
|
|
|
#!/bin/sh
|
2023-04-12 21:41:02 +00:00
|
|
|
config_file="/config/configuration.yaml"
|
|
|
|
if test -f "$config_file"; then
|
2022-06-07 17:41:19 +00:00
|
|
|
echo "configuration.yaml exists."
|
2023-04-12 21:41:02 +00:00
|
|
|
if grep -q recorder: "$config_file"; then
|
|
|
|
echo "configuration.yaml already contains recorder"
|
2022-06-07 17:41:19 +00:00
|
|
|
else
|
2023-05-06 18:51:13 +00:00
|
|
|
echo "" >> "$config_file"
|
2023-04-12 21:41:02 +00:00
|
|
|
cat /config/init/recorder.default >> "$config_file"
|
2022-06-07 17:41:19 +00:00
|
|
|
fi
|
2023-04-12 21:41:02 +00:00
|
|
|
if grep -q http: "$config_file"; then
|
|
|
|
echo "configuration.yaml already contains http section"
|
2022-06-07 17:41:19 +00:00
|
|
|
else
|
2023-05-06 18:51:13 +00:00
|
|
|
echo "" >> "$config_file"
|
2023-04-12 21:41:02 +00:00
|
|
|
cat /config/init/http.default >> "$config_file"
|
2022-06-07 17:41:19 +00:00
|
|
|
fi
|
|
|
|
else
|
2023-04-12 21:41:02 +00:00
|
|
|
echo "configuration.yaml does NOT exist."
|
|
|
|
cp /config/init/configuration.yaml.default "$config_file"
|
2023-04-14 17:39:01 +00:00
|
|
|
echo "" >> "$config_file"
|
2023-04-12 21:41:02 +00:00
|
|
|
cat /config/init/recorder.default >> "$config_file"
|
|
|
|
echo "" >> "$config_file"
|
|
|
|
cat /config/init/http.default >> "$config_file"
|
|
|
|
echo "" >> "$config_file"
|
2022-06-07 17:41:19 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Creating include files..."
|
|
|
|
for include_file in groups.yaml automations.yaml scripts.yaml scenes.yaml; do
|
|
|
|
if test -f "/config/$include_file"; then
|
2023-04-12 21:41:02 +00:00
|
|
|
echo "$include_file exists."
|
2022-06-07 17:41:19 +00:00
|
|
|
else
|
2023-04-12 21:41:02 +00:00
|
|
|
echo "$include_file does NOT exist."
|
|
|
|
touch "/config/$include_file"
|
2022-06-07 17:41:19 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
cd "/config" || echo "Could not change path to /config"
|
|
|
|
echo "Creating custom_components directory..."
|
|
|
|
mkdir "/config/custom_components" || echo "custom_components directory already exists"
|
|
|
|
|
|
|
|
echo "Changing to the custom_components directory..."
|
|
|
|
cd "/config/custom_components" || echo "Could not change path to /config/custom_components"
|
|
|
|
|
|
|
|
echo "Downloading HACS"
|
|
|
|
wget "https://github.com/hacs/integration/releases/latest/download/hacs.zip" || exit 0
|
|
|
|
|
|
|
|
if [ -d "/config/custom_components/hacs" ]; then
|
2023-04-12 21:41:02 +00:00
|
|
|
echo "HACS directory already exist, cleaning up..."
|
|
|
|
rm -R "/config/custom_components/hacs"
|
2022-06-07 17:41:19 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Creating HACS directory..."
|
|
|
|
mkdir "/config/custom_components/hacs"
|
|
|
|
|
|
|
|
echo "Unpacking HACS..."
|
|
|
|
unzip "/config/custom_components/hacs.zip" -d "/config/custom_components/hacs" >/dev/null 2>&1
|
|
|
|
|
|
|
|
echo "Removing HACS zip file..."
|
|
|
|
rm "/config/custom_components/hacs.zip"
|
|
|
|
echo "Installation complete."
|
|
|
|
configuration.yaml.default: |-
|
|
|
|
# Configure a default setup of Home Assistant (frontend, api, etc)
|
|
|
|
default_config:
|
|
|
|
|
|
|
|
# Text to speech
|
|
|
|
tts:
|
|
|
|
- platform: google_translate
|
|
|
|
|
|
|
|
group: !include groups.yaml
|
|
|
|
automation: !include automations.yaml
|
|
|
|
script: !include scripts.yaml
|
|
|
|
scene: !include scenes.yaml
|
|
|
|
recorder.default: |-
|
|
|
|
recorder:
|
|
|
|
purge_keep_days: 30
|
|
|
|
commit_interval: 3
|
2023-04-12 21:41:02 +00:00
|
|
|
db_url: {{ (printf "%s?client_encoding=utf8" (.Values.cnpg.main.creds.std | trimAll "\"")) | quote }}
|
2022-06-07 17:41:19 +00:00
|
|
|
http.default: |-
|
|
|
|
http:
|
|
|
|
use_x_forwarded_for: true
|
|
|
|
trusted_proxies:
|
2022-12-29 22:25:28 +00:00
|
|
|
{{- if hasKey .Values "ixChartContext" }}
|
|
|
|
- {{ .Values.ixChartContext.kubernetes_config.cluster_cidr }}
|
|
|
|
{{- else }}
|
|
|
|
{{- range .Values.homeassistant.trusted_proxies }}
|
|
|
|
- {{ . }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2023-04-11 10:07:17 +00:00
|
|
|
cnpg:
|
|
|
|
main:
|
|
|
|
enabled: true
|
|
|
|
user: home-assistant
|
|
|
|
database: home-assistant
|
2022-08-08 21:25:02 +00:00
|
|
|
|
|
|
|
portal:
|
2023-04-11 10:07:17 +00:00
|
|
|
open:
|
|
|
|
enabled: true
|
|
|
|
|
|
|
|
securityContext:
|
|
|
|
container:
|
|
|
|
readOnlyRootFilesystem: false
|
|
|
|
runAsNonRoot: false
|
|
|
|
runAsUser: 0
|
|
|
|
runAsGroup: 0
|
2023-05-16 08:43:41 +00:00
|
|
|
capabilities:
|
|
|
|
add:
|
|
|
|
- CAP_NET_RAW
|
|
|
|
- CAP_NET_BIND_SERVICE
|