Files
homelab/k8s/apps/z2m/templates/deployment.yaml
T
2023-10-18 18:05:01 -04:00

79 lines
2.3 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ .Release.Name }}"
spec:
replicas: 1
revisionHistoryLimit: 3
strategy:
type: RollingUpdate
selector:
matchLabels:
{{ .Release.Name }}/app: z2m
template:
metadata:
labels:
{{ .Release.Name }}/app: z2m
spec:
affinity:
{{- .Values.affinity | toYaml | nindent 12}}
volumes:
- name: udev
hostPath:
path: /run/udev
- name: zigbee-stick
hostPath:
path: "{{ .Values.devicePath }}"
- name: data-path
persistentVolumeClaim:
claimName: {{ .Values.persistence.data_path.claimName }}
- name: configuration
configMap:
name: z2m-config
containers:
- name: main
imagePullPolicy: "IfNotPresent"
securityContext:
privileged: true
image: "{{ .Values.image }}:{{ .Values.tag | default .Chart.AppVersion }}"
resources:
{{- .Values.resources | toYaml | nindent 14}}
livenessProbe:
tcpSocket:
port: http
initialDelaySeconds: 0
failureThreshold: 3
timeoutSeconds: 1
periodSeconds: 10
readinessProbe:
tcpSocket:
port: http
initialDelaySeconds: 0
failureThreshold: 3
timeoutSeconds: 1
periodSeconds: 10
startupProbe:
tcpSocket:
port: http
initialDelaySeconds: 0
failureThreshold: 30
timeoutSeconds: 1
periodSeconds: 5
env:
- name: TZ
value: "{{ .Values.global.timezone }}"
ports:
- containerPort: 8080
name: http
volumeMounts:
- name: zigbee-stick
mountPath: /dev/ttyUSB0
- name: data-path
mountPath: /app/data
- name: configuration
mountPath: /app/data/configuration.yaml
subPath: configuration.yaml
- name: udev
mountPath: /run/udev