Skip to content

Commit

Permalink
feat(home-assistant): speed up upgrades by preloading container images
Browse files Browse the repository at this point in the history
  • Loading branch information
prehor committed Oct 2, 2024
1 parent 6a39f3f commit db6fda4
Showing 1 changed file with 64 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,31 @@ spec:
- name: volsync
namespace: storage
values:
defaultPodOptions:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: nabucasa.feature.node.kubernetes.io/skyconnect
operator: Exists
annotations:
k8s.v1.cni.cncf.io/networks: |
[{
"name":"multus-iot",
"namespace": "kube-system",
"ips": ["192.168.101.254/24"]
}]
secret.reloader.stakater.com/reload: "home-assistant-emqx-init,home-assistant-secret"
securityContext:
runAsUser: 0
runAsGroup: 0
controllers:
home-assistant:
pod:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: nabucasa.feature.node.kubernetes.io/skyconnect
operator: Exists
annotations:
k8s.v1.cni.cncf.io/networks: |
[{
"name":"multus-iot",
"namespace": "kube-system",
"ips": ["192.168.101.254/24"]
}]
secret.reloader.stakater.com/reload: "home-assistant-emqx-init,home-assistant-secret"
securityContext:
runAsUser: 0
runAsGroup: 0
containers:
app:
image:
image: &home-assistant-image
repository: ghcr.io/home-assistant/home-assistant
tag: 2024.9.3
envFrom:
Expand All @@ -86,7 +86,7 @@ spec:
limits:
memory: 2Gi
code-server:
image:
image: &code-server-image
repository: ghcr.io/coder/code-server
tag: 4.92.2
args: [
Expand Down Expand Up @@ -121,21 +121,21 @@ spec:
) > /tmp/postStart.log 2>&1 || true
initContainers:
emqx-init:
image:
image: &emqx-init-image
repository: ghcr.io/prehor/emqx-init
tag: 1.0.0
envFrom:
- secretRef:
name: home-assistant-emqx-init
recorder-initdb:
image:
recorder-init:
image: &recorder-init-image
repository: ghcr.io/onedr0p/postgres-init
tag: 16
envFrom:
- secretRef:
name: home-assistant-postgres-recorder-initdb
config:
image:
config-init:
image: &config-init-image
repository: docker.io/alpine/git
tag: 2.45.2
command: ["/bin/sh","-c"]
Expand All @@ -147,7 +147,7 @@ spec:
rmdir /config/.hass-config/
fi
usbip-attach:
image:
image: &usbip-attach-image
repository: ghcr.io/prehor/usbip
tag: 6.6.31
restartPolicy: Always # Sidecar container
Expand All @@ -160,6 +160,42 @@ spec:
- /entrypoint.sh --detach
securityContext:
privileged: true
preload-images:
type: job
annotations:
helm.sh/hook: pre-install,pre-upgrade
job:
ttlSecondsAfterFinished: 600
pod:
restartPolicy: never
securityContext:
runAsUser: 568
runAsGroup: 568
containers:
home-assistant:
image:
<<: *home-assistant-image
command: ['/bin/true']
code-server:
image:
<<: *code-server-image
command: ['/bin/true']
emqx-init:
image:
<<: *emqx-init-image
command: ['/bin/true']
recorder-init:
image:
<<: *recorder-init-image
command: ['/bin/true']
config-init:
image:
<<: *config-init-image
command: ['/bin/true']
usbip-attach:
image:
<<: *usbip-attach-image
command: ['/bin/true']
service:
app:
controller: home-assistant
Expand Down

0 comments on commit db6fda4

Please sign in to comment.