diff --git a/k8s/apps/z2m/Chart.yaml b/k8s/apps/z2m/Chart.yaml new file mode 100644 index 0000000..385f4b2 --- /dev/null +++ b/k8s/apps/z2m/Chart.yaml @@ -0,0 +1,7 @@ +apiVersion: v2 +name: motioneye +description: An apps service for homelab +type: application +version: 0.1.0 +appVersion: "edge" +dependencies: [] diff --git a/k8s/apps/z2m/templates/deployment.yaml b/k8s/apps/z2m/templates/deployment.yaml new file mode 100644 index 0000000..5691149 --- /dev/null +++ b/k8s/apps/z2m/templates/deployment.yaml @@ -0,0 +1,68 @@ +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: zigbee-stick + hostPath: + path: "{{ .Values.devicePath }}" + - name: data-path + persistentVolumeClaim: + claimName: {{ .Values.persistence.data_path.claimName }} + containers: + - name: main + imagePullPolicy: "IfNotPresent" + securityContext: + privileged: true + image: "{{ .Values.image }}:{{ .Values.tag | default .Chart.AppVersion }}" + resources: + {{- .Values.resources | toYaml | nindent 14}} + # livenessProbe: + # httpGet: + # path: / + # port: http + # scheme: HTTP + # initialDelaySeconds: 10 + # failureThreshold: 10 + # timeoutSeconds: 30 + # readinessProbe: + # httpGet: + # path: / + # port: http + # scheme: HTTP + # initialDelaySeconds: 10 + # failureThreshold: 10 + # timeoutSeconds: 30 + # startupProbe: + # httpGet: + # path: / + # port: http + # scheme: HTTP + # failureThreshold: 60 + # periodSeconds: 15 + 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 diff --git a/k8s/apps/z2m/templates/service.yaml b/k8s/apps/z2m/templates/service.yaml new file mode 100644 index 0000000..114d533 --- /dev/null +++ b/k8s/apps/z2m/templates/service.yaml @@ -0,0 +1,14 @@ +--- +kind: Service +apiVersion: v1 +metadata: + name: {{ .Release.Name }} +spec: + selector: + {{ .Release.Name }}/app: scrypted + type: ClusterIP + ports: + - port: 80 + targetPort: 80 + name: http + protocol: TCP \ No newline at end of file diff --git a/k8s/apps/z2m/values-dev.yaml b/k8s/apps/z2m/values-dev.yaml new file mode 100644 index 0000000..e69de29 diff --git a/k8s/apps/z2m/values-prod.yaml b/k8s/apps/z2m/values-prod.yaml new file mode 100644 index 0000000..e69de29 diff --git a/k8s/apps/z2m/values.yaml b/k8s/apps/z2m/values.yaml new file mode 100644 index 0000000..c37c393 --- /dev/null +++ b/k8s/apps/z2m/values.yaml @@ -0,0 +1,29 @@ +image: "koenkk/zigbee2mqtt" +tag: "latest" + +flags: + enableNodePort: false + +affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 1 + preference: + matchExpressions: + - key: hardware/zigbee + operator: In + values: + - "yes" +persistence: + data_path: + claimName: "" + +devicePath: /dev/ttyUSB0 + +resources: + requests: + memory: "64Mi" + cpu: "50m" + limits: + memory: "64Mi" + cpu: "50m" diff --git a/k8s/argoapps/values.yaml b/k8s/argoapps/values.yaml index 0ec02a2..0451bc3 100644 --- a/k8s/argoapps/values.yaml +++ b/k8s/argoapps/values.yaml @@ -89,6 +89,12 @@ apps: media_path: enabled: true claimName: {{ .Values.storage.scrypted.name }} + z2m: + values: |- + persistence: + data_path: + enabled: true + claimName: {{ .Values.storage.z2mData.name }} frigate: values: |- persistence: @@ -271,6 +277,16 @@ storage: storage: 100Gi requests: storage: 10Gi + z2mData: + name: z2m-data + namespace: apps-z2m + accessModes: + - ReadWriteMany + resources: + limits: + storage: 2Gi + requests: + storage: 2Gi frigateConf: name: frigate-conf namespace: apps-frigate