From ffde569cbd1f926ba50e5914e6a0521d2e978c55 Mon Sep 17 00:00:00 2001 From: Ariel Sosnovsky Date: Fri, 21 Apr 2023 15:34:01 -0400 Subject: [PATCH] added motioneye --- .vscode/settings.json | 4 +- k8s/apps/motioneye/Chart.yaml | 7 ++++ k8s/apps/motioneye/templates/confgimap.yaml | 9 ++++ k8s/apps/motioneye/templates/deployment.yaml | 41 ++++++++++++++++++ k8s/apps/motioneye/templates/service.yaml | 18 ++++++++ k8s/apps/motioneye/values-dev.yaml | 0 k8s/apps/motioneye/values-prod.yaml | 0 k8s/apps/motioneye/values.yaml | 44 ++++++++++++++++++++ k8s/argoapps/values.yaml | 19 ++++++++- 9 files changed, 140 insertions(+), 2 deletions(-) create mode 100644 k8s/apps/motioneye/Chart.yaml create mode 100644 k8s/apps/motioneye/templates/confgimap.yaml create mode 100644 k8s/apps/motioneye/templates/deployment.yaml create mode 100644 k8s/apps/motioneye/templates/service.yaml create mode 100644 k8s/apps/motioneye/values-dev.yaml create mode 100644 k8s/apps/motioneye/values-prod.yaml create mode 100644 k8s/apps/motioneye/values.yaml diff --git a/.vscode/settings.json b/.vscode/settings.json index 9e26dfe..8c8ce64 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1 +1,3 @@ -{} \ No newline at end of file +{ + "yaml.schemas": {} +} \ No newline at end of file diff --git a/k8s/apps/motioneye/Chart.yaml b/k8s/apps/motioneye/Chart.yaml new file mode 100644 index 0000000..385f4b2 --- /dev/null +++ b/k8s/apps/motioneye/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/motioneye/templates/confgimap.yaml b/k8s/apps/motioneye/templates/confgimap.yaml new file mode 100644 index 0000000..019cccb --- /dev/null +++ b/k8s/apps/motioneye/templates/confgimap.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-configs +data: + motioneye.conf: |- + {{ range $k, $v := .Values.conf }} + {{- $k}} {{$v}} + {{ end }} \ No newline at end of file diff --git a/k8s/apps/motioneye/templates/deployment.yaml b/k8s/apps/motioneye/templates/deployment.yaml new file mode 100644 index 0000000..e0eb9da --- /dev/null +++ b/k8s/apps/motioneye/templates/deployment.yaml @@ -0,0 +1,41 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ .Release.Name }}" +spec: + selector: + matchLabels: + "{{ .Release.Name }}/app": motioneye + template: + metadata: + labels: + "{{ .Release.Name }}/app": motioneye + 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 }} + 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 }} diff --git a/k8s/apps/motioneye/templates/service.yaml b/k8s/apps/motioneye/templates/service.yaml new file mode 100644 index 0000000..5663f85 --- /dev/null +++ b/k8s/apps/motioneye/templates/service.yaml @@ -0,0 +1,18 @@ +--- +kind: Service +apiVersion: v1 +metadata: + name: {{ .Release.Name }} +spec: + selector: + "{{ .Release.Name }}/app": motioneye + type: ClusterIP + ports: + - port: 80 + targetPort: {{ .Values.conf.port }} + name: http + protocol: TCP + - port: {{ .Values.conf.motion_control_port }} + targetPort: {{ .Values.conf.motion_control_port }} + name: control_port + protocol: TCP \ No newline at end of file diff --git a/k8s/apps/motioneye/values-dev.yaml b/k8s/apps/motioneye/values-dev.yaml new file mode 100644 index 0000000..e69de29 diff --git a/k8s/apps/motioneye/values-prod.yaml b/k8s/apps/motioneye/values-prod.yaml new file mode 100644 index 0000000..e69de29 diff --git a/k8s/apps/motioneye/values.yaml b/k8s/apps/motioneye/values.yaml new file mode 100644 index 0000000..79ce6af --- /dev/null +++ b/k8s/apps/motioneye/values.yaml @@ -0,0 +1,44 @@ + +image: "ghcr.io/motioneye-project/motioneye" +tag: "" + +persistence: + media_path: + enabled: false + claimName: "" + +resources: + requests: + memory: "128Mi" + cpu: "500m" + limits: + memory: "1Gi" + cpu: "2" +conf: + server_name: motionEye + conf_path: /etc/motioneye + run_path: /var/run + log_path: /var/log + media_path: /var/lib/motioneye + log_level: info + listen: 0.0.0.0 + port: 8765 + motion_control_localhost: true + motion_control_port: 7999 + motion_check_interval: 10 + motion_restart_on_errors: false + mount_check_interval: 300 + cleanup_interval: 43200 + remote_request_timeout: 10 + mjpg_client_timeout: 10 + mjpg_client_idle_timeout: 10 + smb_shares: false + smb_mount_root: /media + enable_reboot: false + smtp_timeout: 60 + list_media_timeout: 120 + list_media_timeout_email: 10 + zip_timeout: 500 + timelapse_timeout: 500 + add_remove_cameras: true + http_basic_auth: false \ No newline at end of file diff --git a/k8s/argoapps/values.yaml b/k8s/argoapps/values.yaml index c501b3c..b94df51 100644 --- a/k8s/argoapps/values.yaml +++ b/k8s/argoapps/values.yaml @@ -169,6 +169,13 @@ apps: authelia: valuesFile: authelia.yaml + + motioneye: + values: |- + persistence: + media_path: + enabled: true + claimName: {{ .Values.storage.motioneyeMedia.name }} infrastructureCharts: cert-manager: @@ -268,4 +275,14 @@ storage: limits: storage: 100Gi requests: - storage: 10Gi \ No newline at end of file + storage: 10Gi + motioneyeMedia: + name: motioneye-media + namespace: apps-motioneye + accessModes: + - ReadWriteMany + resources: + limits: + storage: 100Gi + requests: + storage: 10Gi