145 lines
5 KiB
YAML
145 lines
5 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "homeassistant.fullname" . }}
|
|
labels:
|
|
{{- include "homeassistant.labels" . | nindent 4 }}
|
|
spec:
|
|
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
|
|
replicas: 1
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
hass.kube.a09.uk/automationService: homeassistant
|
|
{{- include "homeassistant.selectorLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
annotations:
|
|
checksum/initConfig: {{ include (print $.Template.BasePath "/configmap-init.yaml") . | sha256sum }}
|
|
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
|
{{- with .Values.podAnnotations }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
labels:
|
|
hass.kube.a09.uk/automationService: homeassistant
|
|
{{- include "homeassistant.selectorLabels" . | nindent 8 }}
|
|
spec:
|
|
hostNetwork: true
|
|
dnsPolicy: ClusterFirstWithHostNet
|
|
{{- with .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
securityContext:
|
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
priorityClassName: {{ .Values.priorityClassName }}
|
|
containers:
|
|
- name: {{ .Chart.Name }}-homeassistant
|
|
securityContext:
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
args:
|
|
- 'python3'
|
|
- '-m'
|
|
- 'homeassistant'
|
|
- '--config'
|
|
- '/config'
|
|
- '--log-file'
|
|
- '/tmp/home-assistant.log'
|
|
ports:
|
|
- name: https
|
|
containerPort: 443
|
|
protocol: TCP
|
|
#startupProbe:
|
|
# httpGet:
|
|
# path: /
|
|
# port: https
|
|
# failureThreshold: 30
|
|
#livenessProbe:
|
|
# httpGet:
|
|
# path: /
|
|
# port: https
|
|
resources:
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
volumeMounts:
|
|
- name: config
|
|
mountPath: /config
|
|
- name: storage
|
|
mountPath: /media/storage
|
|
- name: database
|
|
mountPath: /media/database
|
|
- name: certificate-secret
|
|
mountPath: /media/certificates
|
|
- name: main-configmap
|
|
mountPath: /media/configuration
|
|
- name: packages-configmap
|
|
mountPath: /media/packages
|
|
- name: custom-sentences-configmap
|
|
mountPath: /media/custom-sentences/en
|
|
securityContext:
|
|
privileged: true
|
|
initContainers:
|
|
- name: init
|
|
image: docker.io/python
|
|
command: ['python', '-u', '/init/init.py']
|
|
resources:
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
volumeMounts:
|
|
- name: config
|
|
mountPath: /config
|
|
- name: init
|
|
mountPath: /init
|
|
{{- with .Values.nodeSelector }}
|
|
nodeSelector:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.affinity }}
|
|
affinity:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.affinity }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
volumes:
|
|
- name: config
|
|
persistentVolumeClaim:
|
|
{{- if not .Values.pvc.config.existingClaim }}
|
|
claimName: {{ include "homeassistant.fullname" . }}-config
|
|
{{- else }}
|
|
claimName: {{ .Values.pvc.config.existingClaim }}
|
|
{{- end }}
|
|
- name: storage
|
|
persistentVolumeClaim:
|
|
{{- if not .Values.pvc.storage.existingClaim }}
|
|
claimName: {{ include "homeassistant.fullname" . }}-storage
|
|
{{- else }}
|
|
claimName: {{ .Values.pvc.storage.existingClaim }}
|
|
{{- end }}
|
|
- name: database
|
|
persistentVolumeClaim:
|
|
{{- if not .Values.pvc.database.existingClaim }}
|
|
claimName: {{ include "homeassistant.fullname" . }}-database
|
|
{{- else }}
|
|
claimName: {{ .Values.pvc.database.existingClaim }}
|
|
{{- end }}
|
|
- name: init
|
|
configMap:
|
|
name: {{ include "homeassistant.fullname" . }}-initscript
|
|
- name: certificate-secret
|
|
secret:
|
|
secretName: {{ include "homeassistant.fullname" . }}-tls-cert-secret
|
|
- name: main-configmap
|
|
configMap:
|
|
name: {{ include "homeassistant.fullname" . }}-configuration
|
|
- name: packages-configmap
|
|
configMap:
|
|
name: {{ include "homeassistant.fullname" . }}-packages
|
|
- name: custom-sentences-configmap
|
|
configMap:
|
|
name: {{ include "homeassistant.fullname" . }}-custom-sentences
|