Files
helm-charts/home-assistant/templates/deployment.yaml
T

85 lines
2.7 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "home-assistant.fullname" . }}
{{- if .Values.namespaceOverride }}
namespace: {{ .Values.namespaceOverride }}
{{- end }}
annotations:
version-source: github-release:home-assistant/core
labels:
{{- include "home-assistant.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
strategy:
type: Recreate
selector:
matchLabels:
{{- include "home-assistant.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "home-assistant.selectorLabels" . | nindent 8 }}
spec:
{{- if .Values.hostNetwork }}
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 8123
protocol: TCP
{{- if .Values.homekit.enabled }}
- name: homekit
containerPort: {{ .Values.homekit.port }}
protocol: TCP
{{- end }}
env:
- name: TZ
value: {{ .Values.timezone | quote }}
volumeMounts:
{{- if .Values.persistence.config.enabled }}
- name: config
mountPath: {{ .Values.persistence.config.mountPath }}
{{- end }}
{{- if .Values.persistence.media.enabled }}
- name: media
mountPath: {{ .Values.persistence.media.mountPath }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
{{- if .Values.persistence.config.enabled }}
- name: config
{{- if eq .Values.persistence.config.type "hostPath" }}
hostPath:
path: {{ .Values.persistence.config.hostPath }}
type: DirectoryOrCreate
{{- else }}
persistentVolumeClaim:
claimName: {{ .Values.persistence.config.existingClaim | default (include "home-assistant.fullname" .) }}
{{- end }}
{{- end }}
{{- if .Values.persistence.media.enabled }}
- name: media
hostPath:
path: {{ .Values.persistence.media.hostPath }}
type: DirectoryOrCreate
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}