From 5b86bdc4ce75a9252aa7c1a1d6198a5fc876dcbe Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Mon, 24 Apr 2023 01:05:32 +0000 Subject: [PATCH] consolidated yamls and removed motioneye --- k8s/apps/{motioneye => frigate}/Chart.yaml | 0 .../templates/deployment.yaml | 29 ++-- k8s/apps/frigate/templates/service.yaml | 26 ++++ .../{motioneye => frigate}/values-dev.yaml | 0 .../{motioneye => frigate}/values-prod.yaml | 0 k8s/apps/frigate/values.yaml | 18 +++ k8s/apps/motioneye/templates/confgimap.yaml | 9 -- k8s/apps/motioneye/templates/service.yaml | 18 --- k8s/apps/motioneye/values.yaml | 47 ------ k8s/argoapps/apps-values/ingresses.yaml | 41 ++++++ k8s/argoapps/apps-values/nextcloud.yaml | 47 ++++++ k8s/argoapps/values.yaml | 134 ++---------------- 12 files changed, 160 insertions(+), 209 deletions(-) rename k8s/apps/{motioneye => frigate}/Chart.yaml (100%) rename k8s/apps/{motioneye => frigate}/templates/deployment.yaml (60%) create mode 100644 k8s/apps/frigate/templates/service.yaml rename k8s/apps/{motioneye => frigate}/values-dev.yaml (100%) rename k8s/apps/{motioneye => frigate}/values-prod.yaml (100%) create mode 100644 k8s/apps/frigate/values.yaml delete mode 100644 k8s/apps/motioneye/templates/confgimap.yaml delete mode 100644 k8s/apps/motioneye/templates/service.yaml delete mode 100644 k8s/apps/motioneye/values.yaml create mode 100644 k8s/argoapps/apps-values/ingresses.yaml create mode 100644 k8s/argoapps/apps-values/nextcloud.yaml diff --git a/k8s/apps/motioneye/Chart.yaml b/k8s/apps/frigate/Chart.yaml similarity index 100% rename from k8s/apps/motioneye/Chart.yaml rename to k8s/apps/frigate/Chart.yaml diff --git a/k8s/apps/motioneye/templates/deployment.yaml b/k8s/apps/frigate/templates/deployment.yaml similarity index 60% rename from k8s/apps/motioneye/templates/deployment.yaml rename to k8s/apps/frigate/templates/deployment.yaml index 611604a..f619091 100644 --- a/k8s/apps/motioneye/templates/deployment.yaml +++ b/k8s/apps/frigate/templates/deployment.yaml @@ -5,19 +5,13 @@ metadata: spec: selector: matchLabels: - {{ .Release.Name }}/app: motioneye + {{ .Release.Name }}/app: frigate template: metadata: labels: - {{ .Release.Name }}/app: motioneye - annotations: - {{ .Release.Name }}/config-checksum: "{{ .Values.conf | toJson | sha256sum }}" + {{ .Release.Name }}/app: frigate spec: volumes: - - name: config - configMap: - name: {{ .Release.Name }}-configs - defaultMode: 420 {{- if .Values.persistence.media_path.enabled }} - name: media-path persistentVolumeClaim: @@ -34,19 +28,22 @@ spec: resources: {{- .Values.resources | toYaml | nindent 14}} ports: - - containerPort: {{ .Values.conf.port }} + - containerPort: 5000 name: http - - containerPort: {{ .Values.conf.motion_control_port }} - name: control-port + - containerPort: 8554 + name: rtsp + - containerPort: 8555 + name: webrtc-tcp + protocol: TCP + - containerPort: 8555 + name: webrtc-udp + protocol: UDP 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 }} + mountPath: /media/frigate {{ end }} {{- if .Values.persistence.conf_path.enabled }} - name: conf-path - mountPath: {{ .Values.conf.conf_path }} + mountPath: /config {{ end }} diff --git a/k8s/apps/frigate/templates/service.yaml b/k8s/apps/frigate/templates/service.yaml new file mode 100644 index 0000000..846d3e2 --- /dev/null +++ b/k8s/apps/frigate/templates/service.yaml @@ -0,0 +1,26 @@ +--- +kind: Service +apiVersion: v1 +metadata: + name: {{ .Release.Name }} +spec: + selector: + {{ .Release.Name }}/app: frigate + type: ClusterIP + ports: + - port: 80 + targetPort: 5000 + name: http + protocol: TCP + - port: 8554 + targetPort: 8554 + name: rtsp + protocol: TCP + - port: 8555 + targetPort: 8555 + name: webrtc-tcp + protocol: TCP + - port: 8555 + targetPort: 8555 + name: webrtc-udp + protocol: UDP \ No newline at end of file diff --git a/k8s/apps/motioneye/values-dev.yaml b/k8s/apps/frigate/values-dev.yaml similarity index 100% rename from k8s/apps/motioneye/values-dev.yaml rename to k8s/apps/frigate/values-dev.yaml diff --git a/k8s/apps/motioneye/values-prod.yaml b/k8s/apps/frigate/values-prod.yaml similarity index 100% rename from k8s/apps/motioneye/values-prod.yaml rename to k8s/apps/frigate/values-prod.yaml diff --git a/k8s/apps/frigate/values.yaml b/k8s/apps/frigate/values.yaml new file mode 100644 index 0000000..9b8bf62 --- /dev/null +++ b/k8s/apps/frigate/values.yaml @@ -0,0 +1,18 @@ +image: "ghcr.io/blakeblackshear/frigate" +tag: "0.12.0" + +persistence: + media_path: + enabled: false + claimName: "" + conf_path: + enabled: false + claimName: "" + +resources: + requests: + memory: "128Mi" + cpu: "500m" + limits: + memory: "1Gi" + cpu: "2" diff --git a/k8s/apps/motioneye/templates/confgimap.yaml b/k8s/apps/motioneye/templates/confgimap.yaml deleted file mode 100644 index 019cccb..0000000 --- a/k8s/apps/motioneye/templates/confgimap.yaml +++ /dev/null @@ -1,9 +0,0 @@ -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/service.yaml b/k8s/apps/motioneye/templates/service.yaml deleted file mode 100644 index 0db8aee..0000000 --- a/k8s/apps/motioneye/templates/service.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- -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.yaml b/k8s/apps/motioneye/values.yaml deleted file mode 100644 index a582c91..0000000 --- a/k8s/apps/motioneye/values.yaml +++ /dev/null @@ -1,47 +0,0 @@ - -image: "ghcr.io/motioneye-project/motioneye" -tag: "" - -persistence: - media_path: - enabled: false - claimName: "" - conf_path: - enabled: false - claimName: "" - -resources: - requests: - memory: "128Mi" - cpu: "500m" - limits: - memory: "1Gi" - cpu: "2" -conf: - server_name: motionEye - conf_path: /etc/motioneye/extra/conf - 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/apps-values/ingresses.yaml b/k8s/argoapps/apps-values/ingresses.yaml new file mode 100644 index 0000000..c380265 --- /dev/null +++ b/k8s/argoapps/apps-values/ingresses.yaml @@ -0,0 +1,41 @@ +services: + - prefix: "argocd.core" + service: "argocd-server" + namespace: "argocd" + - prefix: "monitoring.core" + service: prometheus-kube-prometheus-prometheus + namespace: chart-prometheus + middleware: "apps-ingresses-chain-authelia" + port: 9090 + - prefix: "alerts.core" + service: prometheus-kube-prometheus-alertmanager + namespace: chart-prometheus + middleware: "apps-ingresses-chain-authelia" + port: 9093 + - prefix: "grafana.core" + service: prometheus-grafana + namespace: chart-prometheus + middleware: "apps-ingresses-chain-authelia" + - prefix: "demo" + service: "dummy-app" + namespace: "apps-ingresses" + - prefix: "nextcloud" + service: "nextcloud" + namespace: "apps-nextcloud" + port: 8080 + middleware: "apps-nextcloud-nextcloud" + - prefix: "plex" + service: "plex" + namespace: "apps-videohosting" + port: 32400 + {{- range $k, $v := .Values.videohosting.linuxserverServices }} + - prefix: "{{ $k }}.vh" + service: "{{ $k }}" + namespace: "apps-videohosting" + port: {{ $v.ports.tcp.web }} + middleware: "apps-ingresses-chain-authelia" + {{- end }} + - prefix: "frigate" + service: "frigate" + namespace: "apps-frigate" + middleware: "apps-ingresses-chain-authelia" \ No newline at end of file diff --git a/k8s/argoapps/apps-values/nextcloud.yaml b/k8s/argoapps/apps-values/nextcloud.yaml new file mode 100644 index 0000000..c217684 --- /dev/null +++ b/k8s/argoapps/apps-values/nextcloud.yaml @@ -0,0 +1,47 @@ +nextcloud: + nextcloud: + host: "nextcloud.{{ .Values.global.domain }}" + externalDatabase: + host: postgres.chart-database.svc.cluster.local + persistence: + storageClass: { { .Values.global.nfs.storageClass } } + existingClaim: { { .Values.storage.nextcloudConfig.name } } + nextcloudData: + storageClass: { { .Values.global.nfs.storageClass } } + existingClaim: { { .Values.storage.nextcloudData.name } } + configs: + authelia.config.php: |- + false, + 'lost_password_link' => 'disabled', + 'oidc_login_provider_url' => 'https://auth.core.{{ .Values.global.domain }}', + 'oidc_login_client_id' => 'nextcloud', + 'oidc_login_client_secret' => 'xjW7ByDrY0IpGo6XC5o6eQEUGagjkK6hULfbtADO5GV-ugHiG1ri1FRvkfL.-sacdHWyqZyO', + 'oidc_login_auto_redirect' => false, + 'oidc_login_end_session_redirect' => false, + 'oidc_login_button_text' => 'Log in with Authelia', + 'oidc_login_hide_password_form' => false, + 'oidc_login_use_id_token' => true, + 'oidc_login_attributes' => array ( + 'id' => 'preferred_username', + 'name' => 'name', + 'mail' => 'email', + 'groups' => 'groups', + ), + 'oidc_login_default_group' => 'oidc', + 'oidc_login_use_external_storage' => false, + 'oidc_login_scope' => 'openid profile email groups', + 'oidc_login_proxy_ldap' => false, + 'oidc_login_disable_registration' => true, + 'oidc_login_redir_fallback' => false, + 'oidc_login_alt_login_page' => 'assets/login.php', + 'oidc_login_tls_verify' => true, + 'oidc_create_groups' => false, + 'oidc_login_webdav_enabled' => false, + 'oidc_login_password_authentication' => false, + 'oidc_login_public_key_caching_time' => 86400, + 'oidc_login_min_time_between_jwks_requests' => 10, + 'oidc_login_well_known_caching_time' => 86400, + 'oidc_login_update_avatar' => false, + ); diff --git a/k8s/argoapps/values.yaml b/k8s/argoapps/values.yaml index 7b23fdd..fcaf8ef 100644 --- a/k8s/argoapps/values.yaml +++ b/k8s/argoapps/values.yaml @@ -22,8 +22,7 @@ global: email: "ariel.sosnovsky@gmail.com" mqtt: port: 1883 - host: 192.168.0.20 - + host: 192.168.0.20 videohosting: linuxserverServices: @@ -58,104 +57,12 @@ apps: videohosting: values: |- {{ .Values.videohosting | toYaml }} + nextcloud: - values: |- - nextcloud: - nextcloud: - host: "nextcloud.{{ .Values.global.domain }}" - externalDatabase: - host: postgres.chart-database.svc.cluster.local - persistence: - storageClass: {{ .Values.global.nfs.storageClass }} - existingClaim: {{ .Values.storage.nextcloudConfig.name }} - nextcloudData: - storageClass: {{ .Values.global.nfs.storageClass }} - existingClaim: {{ .Values.storage.nextcloudData.name }} - configs: - authelia.config.php: |- - false, - 'lost_password_link' => 'disabled', - 'oidc_login_provider_url' => 'https://auth.core.{{ .Values.global.domain }}', - 'oidc_login_client_id' => 'nextcloud', - 'oidc_login_client_secret' => 'xjW7ByDrY0IpGo6XC5o6eQEUGagjkK6hULfbtADO5GV-ugHiG1ri1FRvkfL.-sacdHWyqZyO', - 'oidc_login_auto_redirect' => false, - 'oidc_login_end_session_redirect' => false, - 'oidc_login_button_text' => 'Log in with Authelia', - 'oidc_login_hide_password_form' => false, - 'oidc_login_use_id_token' => true, - 'oidc_login_attributes' => array ( - 'id' => 'preferred_username', - 'name' => 'name', - 'mail' => 'email', - 'groups' => 'groups', - ), - 'oidc_login_default_group' => 'oidc', - 'oidc_login_use_external_storage' => false, - 'oidc_login_scope' => 'openid profile email groups', - 'oidc_login_proxy_ldap' => false, - 'oidc_login_disable_registration' => true, - 'oidc_login_redir_fallback' => false, - 'oidc_login_alt_login_page' => 'assets/login.php', - 'oidc_login_tls_verify' => true, - 'oidc_create_groups' => false, - 'oidc_login_webdav_enabled' => false, - 'oidc_login_password_authentication' => false, - 'oidc_login_public_key_caching_time' => 86400, - 'oidc_login_min_time_between_jwks_requests' => 10, - 'oidc_login_well_known_caching_time' => 86400, - 'oidc_login_update_avatar' => false, - ); + valuesFile: nextcloud.yaml ingresses: - values: |- - services: - - prefix: "argocd.core" - service: "argocd-server" - namespace: "argocd" - - prefix: "monitoring.core" - service: prometheus-kube-prometheus-prometheus - namespace: chart-prometheus - middleware: "apps-ingresses-chain-authelia" - port: 9090 - - prefix: "alerts.core" - service: prometheus-kube-prometheus-alertmanager - namespace: chart-prometheus - middleware: "apps-ingresses-chain-authelia" - port: 9093 - - prefix: "grafana.core" - service: prometheus-grafana - namespace: chart-prometheus - middleware: "apps-ingresses-chain-authelia" - - prefix: "demo" - service: "dummy-app" - namespace: "apps-ingresses" - - prefix: "nextcloud" - service: "nextcloud" - namespace: "apps-nextcloud" - port: 8080 - middleware: "apps-nextcloud-nextcloud" - - prefix: "plex" - service: "plex" - namespace: "apps-videohosting" - port: 32400 - {{- range $k, $v := .Values.videohosting.linuxserverServices }} - - prefix: "{{ $k }}.vh" - service: "{{ $k }}" - namespace: "apps-videohosting" - port: {{ $v.ports.tcp.web }} - middleware: "apps-ingresses-chain-authelia" - {{- end }} - - prefix: "frigate" - service: "frigate" - namespace: "chart-frigate" - middleware: "apps-ingresses-chain-authelia" - port: 5000 - - prefix: "motioneye" - service: "motioneye" - namespace: "apps-motioneye" - middleware: "apps-ingresses-chain-authelia" + valuesFile: ingresses.yaml db-users: namespace: chart-database @@ -174,16 +81,16 @@ apps: authelia: valuesFile: authelia.yaml - - motioneye: - values: |- + + frigate: + values: |- persistence: media_path: enabled: true - claimName: {{ .Values.storage.motioneyeMedia.name }} + claimName: {{ .Values.storage.frigateMedia.name }} conf_path: enabled: true - claimName: {{ .Values.storage.motioneyeConf.name }} + claimName: {{ .Values.storage.frigateConf.name }} infrastructureCharts: cert-manager: @@ -214,17 +121,6 @@ infrastructureCharts: repoURL: "https://charts.bitnami.com/bitnami" targetRevision: "12.1.8" valuesFile: database.yaml - frigate: - repoURL: "https://blakeblackshear.github.io/blakeshome-charts/" - chart: "frigate" - targetRevision: "7.0.0" - values: |- - config: | - mqtt: - host: "{{ .Values.global.mqtt.host }}" - port: {{ .Values.global.mqtt.port }} - user: "{{ .Values.global.mqtt.username }}" - password: "{{ .Values.global.mqtt.password }}" prometheus: chart: kube-prometheus-stack repoURL: "https://prometheus-community.github.io/helm-charts" @@ -284,9 +180,9 @@ storage: storage: 100Gi requests: storage: 10Gi - motioneyeMedia: - name: motioneye-media - namespace: apps-motioneye + frigateMedia: + name: frigate-media + namespace: apps-frigate accessModes: - ReadWriteMany resources: @@ -294,9 +190,9 @@ storage: storage: 100Gi requests: storage: 10Gi - motioneyeConf: - name: motioneye-conf - namespace: apps-motioneye + frigateConf: + name: frigate-conf + namespace: apps-frigate accessModes: - ReadWriteMany resources: