Files
homelab/k8s/apps/motioneye/templates/deployment.yaml
T
2023-04-21 15:54:38 -04:00

52 lines
1.8 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ .Release.Name }}"
spec:
selector:
matchLabels:
{{ .Release.Name }}/app: motioneye
template:
metadata:
labels:
{{ .Release.Name }}/app: motioneye
{{ .Release.Name }}/config-checksum: "{{ .Values.conf | toJson | sha256sum }}"
spec:
volumes:
- name: config
configMap:
name: {{ .Release.Name }}-configs
defaultMode: 420
{{- if .Values.persistence.media_path.enabled }}
- name: media-path
persistentVolumeClaim:
claimName: {{ .Values.persistence.media_path.claimName }}
{{- end }}
{{- if .Values.persistence.conf_path.enabled }}
- name: conf-path
persistentVolumeClaim:
claimName: {{ .Values.persistence.conf_path.claimName }}
{{- end }}
containers:
- name: main
image: "{{ .Values.image }}:{{ .Values.tag | default .Chart.AppVersion }}"
resources:
{{- .Values.resources | toYaml | nindent 14}}
ports:
- containerPort: {{ .Values.conf.port }}
name: http
- containerPort: {{ .Values.conf.motion_control_port }}
name: control-port
volumeMounts:
- name: config
mountPath: /etc/motioneye/motioneye.conf
subPath: "motioneye.conf"
{{- if .Values.persistence.media_path.enabled }}
- name: media-path
mountPath: {{ .Values.conf.media_path }}
{{ end }}
{{- if .Values.persistence.conf_path.enabled }}
- name: conf-path
mountPath: {{ .Values.conf.conf_path }}
{{ end }}