Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(home): upgrade frigate helmrelease and kustomization #1926

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

blackjid
Copy link
Owner

No description provided.

@bot-x-mod
Copy link
Contributor

bot-x-mod bot commented Dec 15, 2023

--- kubernetes/main/apps Kustomization: flux-system/cluster-apps PersistentVolumeClaim: home/frigate-data-0

+++ kubernetes/main/apps Kustomization: flux-system/cluster-apps PersistentVolumeClaim: home/frigate-data-0

@@ -1,17 +0,0 @@

----
-apiVersion: v1
-kind: PersistentVolumeClaim
-metadata:
-  labels:
-    kustomize.toolkit.fluxcd.io/name: cluster-apps
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: frigate-data-0
-  namespace: home
-spec:
-  accessModes:
-  - ReadWriteOnce
-  resources:
-    requests:
-      storage: 1Gi
-  storageClassName: ceph-block
-
--- kubernetes/main/apps Kustomization: flux-system/cluster-apps ExternalSecret: home/frigate

+++ kubernetes/main/apps Kustomization: flux-system/cluster-apps ExternalSecret: home/frigate

@@ -1,28 +0,0 @@

----
-apiVersion: external-secrets.io/v1beta1
-kind: ExternalSecret
-metadata:
-  labels:
-    kustomize.toolkit.fluxcd.io/name: cluster-apps
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: frigate
-  namespace: home
-spec:
-  dataFrom:
-  - extract:
-      key: frigate
-  secretStoreRef:
-    kind: ClusterSecretStore
-    name: onepassword-connect
-  target:
-    creationPolicy: Owner
-    name: frigate-secret
-    template:
-      data:
-        FRIGATE_MQTT_PASSWORD: '{{ .MQTT_PASSWORD }}'
-        FRIGATE_MQTT_USERNAME: '{{ .MQTT_USERNAME }}'
-        FRIGATE_REOLINK_PASSWORD: '{{ .REOLINK_PASSWORD }}'
-        FRIGATE_REOLINK_USER: '{{ .REOLINK_USER }}'
-        PLUS_API_KEY: '{{ .PLUS_API_KEY }}'
-      engineVersion: v2
-
--- kubernetes/main/apps Kustomization: flux-system/cluster-apps HelmRelease: home/frigate

+++ kubernetes/main/apps Kustomization: flux-system/cluster-apps HelmRelease: home/frigate

@@ -1,168 +0,0 @@

----
-apiVersion: helm.toolkit.fluxcd.io/v2beta2
-kind: HelmRelease
-metadata:
-  labels:
-    kustomize.toolkit.fluxcd.io/name: cluster-apps
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: frigate
-  namespace: home
-spec:
-  chart:
-    spec:
-      chart: app-template
-      sourceRef:
-        kind: HelmRepository
-        name: bjw-s
-        namespace: flux-system
-      version: 2.2.0
-  dependsOn:
-  - name: intel-device-plugin-gpu
-    namespace: kube-system
-  - name: rook-ceph-cluster
-    namespace: rook-ceph
-  - name: volsync
-    namespace: volsync
-  install:
-    remediation:
-      retries: 3
-  interval: 30m
-  maxHistory: 2
-  uninstall:
-    keepHistory: false
-  upgrade:
-    cleanupOnFail: true
-    remediation:
-      retries: 3
-  values:
-    controllers:
-      main:
-        annotations:
-          reloader.stakater.com/auto: 'true'
-        containers:
-          main:
-            env:
-              LIBVA_DRIVER_NAME: i965
-              TZ: America/Santiago
-            envFrom:
-            - secretRef:
-                name: frigate-secret
-            image:
-              repository: ghcr.io/blakeblackshear/frigate
-              tag: 0.13.0-beta6
-            probes:
-              liveness:
-                custom: true
-                enabled: true
-                spec:
-                  failureThreshold: 3
-                  httpGet:
-                    path: /api/version
-                    port: 5000
-                  initialDelaySeconds: 0
-                  periodSeconds: 10
-                  timeoutSeconds: 1
-              readiness:
-                custom: true
-                enabled: true
-                spec:
-                  failureThreshold: 3
-                  httpGet:
-                    path: /api/version
-                    port: 5000
-                  initialDelaySeconds: 0
-                  periodSeconds: 10
-                  timeoutSeconds: 1
-              startup:
-                enabled: false
-            resources:
-              limits:
-                gpu.intel.com/i915: 1
-                memory: 10Gi
-              requests:
-                cpu: 1000m
-                gpu.intel.com/i915: 1
-                memory: 2Gi
-            securityContext:
-              privileged: true
-        pod:
-          affinity:
-            podAntiAffinity:
-              requiredDuringSchedulingIgnoredDuringExecution:
-              - labelSelector:
-                  matchExpressions:
-                  - key: app.kubernetes.io/name
-                    operator: In
-                    values:
-                    - plex
-                topologyKey: kubernetes.io/hostname
-          nodeSelector:
-            google.feature.node.kubernetes.io/coral: 'true'
-            intel.feature.node.kubernetes.io/gpu: 'true'
-        statefulset:
-          volumeClaimTemplates:
-          - accessMode: ReadWriteOnce
-            globalMounts:
-            - path: /data
-            name: config
-            size: 5Gi
-            storageClass: ceph-block
-        type: statefulset
-    ingress:
-      main:
-        annotations:
-          external-dns.alpha.kubernetes.io/target: ingress.donoso.family
-          hajimari.io/icon: mdi:cctv
-        className: nginx
-        enabled: true
-        hosts:
-        - host: frigate.donoso.family
-          paths:
-          - path: /
-            service:
-              name: main
-              port: http
-        tls:
-        - hosts:
-          - frigate.donoso.family
-    persistence:
-      cache:
-        enabled: true
-        globalMounts:
-        - path: /dev/shm
-        medium: Memory
-        sizeLimit: 2Gi
-        type: emptyDir
-      config-file:
-        globalMounts:
-        - path: /config/config.yml
-          readOnly: true
-          subPath: config.yml
-        name: frigate-configmap
-        type: configMap
-      media:
-        enabled: true
-        mountPath: /media
-        readOnly: false
-        type: custom
-        volumeSpec:
-          nfs:
-            path: /volume1/frigate
-            server: 10.2.1.50
-      usb:
-        enabled: true
-        globalMounts:
-        - path: /dev/bus/usb
-        hostPath: /dev/bus/usb
-        hostPathType: Directory
-        type: hostPath
-    service:
-      externalTrafficPolicy: Local
-      main:
-        ports:
-          http:
-            port: 5000
-          rtsp:
-            port: 8554
-      type: LoadBalancer
-
--- kubernetes/main/apps Kustomization: flux-system/cluster-apps ExternalSecret: home/frigate-restic

+++ kubernetes/main/apps Kustomization: flux-system/cluster-apps ExternalSecret: home/frigate-restic

@@ -1,27 +0,0 @@

----
-apiVersion: external-secrets.io/v1beta1
-kind: ExternalSecret
-metadata:
-  labels:
-    kustomize.toolkit.fluxcd.io/name: cluster-apps
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: frigate-restic
-  namespace: home
-spec:
-  dataFrom:
-  - extract:
-      key: volsync-restic-template
-  secretStoreRef:
-    kind: ClusterSecretStore
-    name: onepassword-connect
-  target:
-    creationPolicy: Owner
-    name: frigate-restic-secret
-    template:
-      data:
-        AWS_ACCESS_KEY_ID: '{{ .AWS_ACCESS_KEY_ID }}'
-        AWS_SECRET_ACCESS_KEY: '{{ .AWS_SECRET_ACCESS_KEY }}'
-        RESTIC_PASSWORD: '{{ .RESTIC_PASSWORD }}'
-        RESTIC_REPOSITORY: '{{ .REPOSITORY_TEMPLATE }}/frigate'
-      engineVersion: v2
-
--- kubernetes/main/apps Kustomization: flux-system/cluster-apps ReplicationSource: home/frigate

+++ kubernetes/main/apps Kustomization: flux-system/cluster-apps ReplicationSource: home/frigate

@@ -1,24 +0,0 @@

----
-apiVersion: volsync.backube/v1alpha1
-kind: ReplicationSource
-metadata:
-  labels:
-    kustomize.toolkit.fluxcd.io/name: cluster-apps
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: frigate
-  namespace: home
-spec:
-  restic:
-    cacheCapacity: 8Gi
-    copyMethod: Snapshot
-    pruneIntervalDays: 7
-    repository: frigate-restic-secret
-    retain:
-      daily: 7
-      within: 3d
-    storageClassName: ceph-block
-    volumeSnapshotClassName: csi-ceph-blockpool
-  sourcePVC: config-frigate-0
-  trigger:
-    schedule: 0 7 * * *
-
--- kubernetes/main/apps Kustomization: flux-system/cluster-apps ConfigMap: home/frigate-configmap

+++ kubernetes/main/apps Kustomization: flux-system/cluster-apps ConfigMap: home/frigate-configmap

@@ -1,156 +0,0 @@

----
-apiVersion: v1
-data:
-  config.yml: |
-    ---
-    # yaml-language-server: $schema=https://frigate.donoso.family/api/config/schema.json
-    logger:
-      default: info
-      # logs:
-      #   frigate.record: debug
-
-    mqtt:
-      host: emqx.home.svc
-      port: 1883
-      topic_prefix: frigate
-      user: "{FRIGATE_MQTT_USERNAME}"
-      password: "{FRIGATE_MQTT_PASSWORD}"
-
-    database:
-      path: /data/frigate.db
-
-    detectors:
-      coral:
-        type: edgetpu
-        device: usb
-
-    ffmpeg:
-      # global_args: ["-hide_banner", "-loglevel", "warning"]
-      # input_args: preset-rtsp-generic
-      hwaccel_args: preset-vaapi
-      # output_args:
-      #   record: preset-record-generic
-
-    birdseye:
-      enabled: false
-
-    snapshots:
-      enabled: true
-      timestamp: false
-      bounding_box: true
-      retain:
-        default: 2
-
-    record:
-      enabled: true
-      retain:
-        days: 2
-        mode: all
-      events:
-        retain:
-          default: 2
-          mode: active_objects
-
-    objects:
-      track: ["person", "cat", "dog", "car"]
-      filters:
-        person:
-          min_area: 5000
-          max_area: 100000
-          threshold: 0.7
-
-    go2rtc:
-      webrtc:
-          candidates:
-            - 10.2.1.103:8555
-            - stun:8555
-      streams:
-        backyard:
-          - rtsp://{FRIGATE_REOLINK_USER}:{FRIGATE_REOLINK_PASSWORD}@10.0.2.238:554/h264Preview_01_main
-        backyard_sub:
-          - rtsp://{FRIGATE_REOLINK_USER}:{FRIGATE_REOLINK_PASSWORD}@10.0.2.238:554/h264Preview_01_sub
-        entrance:
-          - rtsp://{FRIGATE_REOLINK_USER}:{FRIGATE_REOLINK_PASSWORD}@10.0.2.222:554/h264Preview_01_main
-        entrance_sub:
-          - rtsp://{FRIGATE_REOLINK_USER}:{FRIGATE_REOLINK_PASSWORD}@10.0.2.222:554/h264Preview_01_sub
-        living_room:
-          - rtsp://wyze-bridge.home.svc.cluster.local:8554/living-room-ceiling
-        living_room_sub:
-          - rtsp://wyze-bridge.home.svc.cluster.local:8554/living-room-ceiling-sub
-        family_room:
-          - rtsp://wyze-bridge.home.svc.cluster.local:8554/family-room
-        family_room_sub:
-          - rtsp://wyze-bridge.home.svc.cluster.local:8554/family-room-sub
-
-    # Specify camera's
-    cameras:
-      backyard:
-        ffmpeg:
-          inputs:
-            - path: rtsp://localhost:8554/backyard
-              roles: ["record"]
-            - path: rtsp://localhost:8554/backyard_sub
-              roles: ["detect"]
-        detect:
-          width: 640
-          height: 360
-          fps: 10
-
-      entrance:
-        ffmpeg:
-          inputs:
-            - path: rtsp://localhost:8554/entrance
-              roles: ["record"]
-            - path: rtsp://localhost:8554/entrance_sub
-              roles: ["detect"]
-        detect:
-          width: 640
-          height: 360
-          fps: 10
-        zones:
-          parking_lot:
-            coordinates: 134,360,474,360,516,149,219,107,0,240
-        motion:
-          mask:
-            - 0,360,144,360,139,316,0,297
-            - 503,311,538,221,567,125,583,0,483,0,441,0
-            - 464,0,440,35,253,43,123,91,0,129,0,0
-            - 640,0,640,29,444,28,443,0
-
-      living_room:
-        ffmpeg:
-          inputs:
-            - path: rtsp://localhost:8554/living_room_sub
-              input_args: preset-rtsp-restream
-              roles: ["detect"]
-            - path: rtsp://localhost:8554/living_room
-              input_args: preset-rtsp-restream
-              roles: ["record"]
-        detect:
-          width: 640
-          height: 360
-          fps: 10
-
-      family_room:
-        ffmpeg:
-          inputs:
-            - path: rtsp://localhost:8554/family_room_sub
-              input_args: preset-rtsp-restream
-              roles: ["detect"]
-            - path: rtsp://localhost:8554/family_room
-              input_args: preset-rtsp-restream
-              roles: ["record"]
-        detect:
-          width: 640
-          height: 360
-          fps: 10
-kind: ConfigMap
-metadata:
-  annotations:
-    kustomize.toolkit.fluxcd.io/substitute: disabled
-  labels:
-    kustomize.toolkit.fluxcd.io/name: cluster-apps
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: frigate-configmap
-  namespace: home
-
--- kubernetes/main/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/frigate

+++ kubernetes/main/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/frigate

@@ -0,0 +1,40 @@

+---
+apiVersion: kustomize.toolkit.fluxcd.io/v1
+kind: Kustomization
+metadata:
+  labels:
+    kustomize.toolkit.fluxcd.io/name: cluster-apps
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: frigate
+  namespace: flux-system
+spec:
+  commonMetadata:
+    labels:
+      app.kubernetes.io/name: frigate
+  decryption:
+    provider: sops
+    secretRef:
+      name: sops-age
+  dependsOn:
+  - name: external-secrets-stores
+  - name: node-feature-discovery-rules
+  interval: 30m
+  path: ./kubernetes/main/apps/home/frigate/app
+  postBuild:
+    substitute:
+      APP: frigate
+      VOLSYNC_CAPACITY: 5Gi
+    substituteFrom:
+    - kind: ConfigMap
+      name: cluster-settings
+    - kind: Secret
+      name: cluster-secrets
+  prune: true
+  retryInterval: 1m
+  sourceRef:
+    kind: GitRepository
+    name: home-kubernetes
+  targetNamespace: home
+  timeout: 5m
+  wait: false
+
--- kubernetes/main/apps/home/frigate/app Kustomization: flux-system/frigate ExternalSecret: home/frigate

+++ kubernetes/main/apps/home/frigate/app Kustomization: flux-system/frigate ExternalSecret: home/frigate

@@ -0,0 +1,29 @@

+---
+apiVersion: external-secrets.io/v1beta1
+kind: ExternalSecret
+metadata:
+  labels:
+    app.kubernetes.io/name: frigate
+    kustomize.toolkit.fluxcd.io/name: frigate
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: frigate
+  namespace: home
+spec:
+  dataFrom:
+  - extract:
+      key: frigate
+  secretStoreRef:
+    kind: ClusterSecretStore
+    name: onepassword-connect
+  target:
+    creationPolicy: Owner
+    name: frigate-secret
+    template:
+      data:
+        FRIGATE_MQTT_PASSWORD: '{{ .MQTT_PASSWORD }}'
+        FRIGATE_MQTT_USERNAME: '{{ .MQTT_USERNAME }}'
+        FRIGATE_REOLINK_PASSWORD: '{{ .REOLINK_PASSWORD }}'
+        FRIGATE_REOLINK_USER: '{{ .REOLINK_USER }}'
+        PLUS_API_KEY: '{{ .PLUS_API_KEY }}'
+      engineVersion: v2
+
--- kubernetes/main/apps/home/frigate/app Kustomization: flux-system/frigate HelmRelease: home/frigate

+++ kubernetes/main/apps/home/frigate/app Kustomization: flux-system/frigate HelmRelease: home/frigate

@@ -0,0 +1,167 @@

+---
+apiVersion: helm.toolkit.fluxcd.io/v2beta2
+kind: HelmRelease
+metadata:
+  labels:
+    app.kubernetes.io/name: frigate
+    kustomize.toolkit.fluxcd.io/name: frigate
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: frigate
+  namespace: home
+spec:
+  chart:
+    spec:
+      chart: app-template
+      sourceRef:
+        kind: HelmRepository
+        name: bjw-s
+        namespace: flux-system
+      version: 2.4.0
+  dependsOn:
+  - name: intel-device-plugin-gpu
+    namespace: kube-system
+  - name: emqx
+    namespace: home
+  - name: rook-ceph-cluster
+    namespace: rook-ceph
+  - name: volsync
+    namespace: volsync
+  install:
+    remediation:
+      retries: 3
+  interval: 30m
+  maxHistory: 2
+  uninstall:
+    keepHistory: false
+  upgrade:
+    cleanupOnFail: true
+    remediation:
+      retries: 3
+  values:
+    controllers:
+      main:
+        annotations:
+          reloader.stakater.com/auto: 'true'
+        containers:
+          main:
+            env:
+              LIBVA_DRIVER_NAME: i965
+              TZ: America/Santiago
+            envFrom:
+            - secretRef:
+                name: frigate-secret
+            image:
+              repository: ghcr.io/blakeblackshear/frigate
+              tag: 0.13.0-beta6
+            probes:
+              liveness:
+                custom: true
+                enabled: true
+                spec:
+                  failureThreshold: 3
+                  httpGet:
+                    path: /api/version
+                    port: 5000
+                  initialDelaySeconds: 0
+                  periodSeconds: 10
+                  timeoutSeconds: 1
+              readiness:
+                custom: true
+                enabled: true
+                spec:
+                  failureThreshold: 3
+                  httpGet:
+                    path: /api/version
+                    port: 5000
+                  initialDelaySeconds: 0
+                  periodSeconds: 10
+                  timeoutSeconds: 1
+              startup:
+                enabled: false
+            resources:
+              limits:
+                gpu.intel.com/i915: '1'
+                memory: 8Gi
+              requests:
+                cpu: 1000m
+                gpu.intel.com/i915: '1'
+                memory: 2Gi
+            securityContext:
+              privileged: true
+        pod:
+          affinity:
+            podAntiAffinity:
+              requiredDuringSchedulingIgnoredDuringExecution:
+              - labelSelector:
+                  matchExpressions:
+                  - key: app.kubernetes.io/name
+                    operator: In
+                    values:
+                    - plex
+                topologyKey: kubernetes.io/hostname
+          nodeSelector:
+            google.feature.node.kubernetes.io/coral: 'true'
+            intel.feature.node.kubernetes.io/gpu: 'true'
+    ingress:
+      main:
+        annotations:
+          external-dns.alpha.kubernetes.io/target: ingress.donoso.family
+          hajimari.io/icon: mdi:cctv
+          nginx.ingress.kubernetes.io/auth-signin: https://auth.donoso.family/oauth2/start
+          nginx.ingress.kubernetes.io/auth-url: https://auth.donoso.family/oauth2/auth
+        className: external
+        enabled: true
+        hosts:
+        - host: '{{ .Release.Name }}.donoso.family'
+          paths:
+          - path: /
+            service:
+              name: main
+              port: http
+        tls:
+        - hosts:
+          - '{{ .Release.Name }}.donoso.family'
+    persistence:
+      cache:
+        enabled: true
+        globalMounts:
+        - path: /dev/shm
+        medium: Memory
+        sizeLimit: 4Gi
+        type: emptyDir
+      config:
+        enabled: true
+        existingClaim: config-frigate-0
+        globalMounts:
+        - path: /data
+      config-file:
+        globalMounts:
+        - path: /config/config.yml
+          readOnly: true
+          subPath: config.yml
+        name: frigate-configmap
+        type: configMap
+      media:
+        enabled: true
+        mountPath: /media
+        readOnly: false
+        type: custom
+        volumeSpec:
+          nfs:
+            path: /volume1/frigate
+            server: 10.2.1.50
+      usb:
+        enabled: true
+        globalMounts:
+        - path: /dev/bus/usb
+        hostPath: /dev/bus/usb
+        hostPathType: Directory
+        type: hostPath
+    service:
+      main:
+        ports:
+          http:
+            port: 5000
+          rtsp:
+            port: 8554
+
--- kubernetes/main/apps/home/frigate/app Kustomization: flux-system/frigate ExternalSecret: home/frigate-restic

+++ kubernetes/main/apps/home/frigate/app Kustomization: flux-system/frigate ExternalSecret: home/frigate-restic

@@ -0,0 +1,28 @@

+---
+apiVersion: external-secrets.io/v1beta1
+kind: ExternalSecret
+metadata:
+  labels:
+    app.kubernetes.io/name: frigate
+    kustomize.toolkit.fluxcd.io/name: frigate
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: frigate-restic
+  namespace: home
+spec:
+  dataFrom:
+  - extract:
+      key: volsync-restic-template
+  secretStoreRef:
+    kind: ClusterSecretStore
+    name: onepassword-connect
+  target:
+    creationPolicy: Owner
+    name: frigate-restic-secret
+    template:
+      data:
+        AWS_ACCESS_KEY_ID: '{{ .AWS_ACCESS_KEY_ID }}'
+        AWS_SECRET_ACCESS_KEY: '{{ .AWS_SECRET_ACCESS_KEY }}'
+        RESTIC_PASSWORD: '{{ .RESTIC_PASSWORD }}'
+        RESTIC_REPOSITORY: '{{ .REPOSITORY_TEMPLATE }}/frigate'
+      engineVersion: v2
+
--- kubernetes/main/apps/home/frigate/app Kustomization: flux-system/frigate ReplicationSource: home/frigate

+++ kubernetes/main/apps/home/frigate/app Kustomization: flux-system/frigate ReplicationSource: home/frigate

@@ -0,0 +1,25 @@

+---
+apiVersion: volsync.backube/v1alpha1
+kind: ReplicationSource
+metadata:
+  labels:
+    app.kubernetes.io/name: frigate
+    kustomize.toolkit.fluxcd.io/name: frigate
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: frigate
+  namespace: home
+spec:
+  restic:
+    cacheCapacity: 8Gi
+    copyMethod: Snapshot
+    pruneIntervalDays: 7
+    repository: frigate-restic-secret
+    retain:
+      daily: 7
+      within: 3d
+    storageClassName: ceph-block
+    volumeSnapshotClassName: csi-ceph-blockpool
+  sourcePVC: config-frigate-0
+  trigger:
+    schedule: 0 7 * * *
+
--- kubernetes/main/apps/home/frigate/app Kustomization: flux-system/frigate ConfigMap: home/frigate-configmap

+++ kubernetes/main/apps/home/frigate/app Kustomization: flux-system/frigate ConfigMap: home/frigate-configmap

@@ -0,0 +1,157 @@

+---
+apiVersion: v1
+data:
+  config.yml: |
+    ---
+    # yaml-language-server: $schema=https://frigate.donoso.family/api/config/schema.json
+    logger:
+      default: info
+      # logs:
+      #   frigate.record: debug
+
+    mqtt:
+      host: emqx.home.svc
+      port: 1883
+      topic_prefix: frigate
+      user: "{FRIGATE_MQTT_USERNAME}"
+      password: "{FRIGATE_MQTT_PASSWORD}"
+
+    database:
+      path: /data/frigate.db
+
+    detectors:
+      coral:
+        type: edgetpu
+        device: usb
+
+    ffmpeg:
+      # global_args: ["-hide_banner", "-loglevel", "warning"]
+      # input_args: preset-rtsp-generic
+      hwaccel_args: preset-vaapi
+      # output_args:
+      #   record: preset-record-generic
+
+    birdseye:
+      enabled: false
+
+    snapshots:
+      enabled: true
+      timestamp: false
+      bounding_box: true
+      retain:
+        default: 2
+
+    record:
+      enabled: true
+      retain:
+        days: 2
+        mode: all
+      events:
+        retain:
+          default: 2
+          mode: active_objects
+
+    objects:
+      track: ["person", "cat", "dog", "car"]
+      filters:
+        person:
+          min_area: 5000
+          max_area: 100000
+          threshold: 0.7
+
+    go2rtc:
+      webrtc:
+          candidates:
+            - 10.2.1.103:8555
+            - stun:8555
+      streams:
+        backyard:
+          - rtsp://{FRIGATE_REOLINK_USER}:{FRIGATE_REOLINK_PASSWORD}@10.0.2.238:554/h264Preview_01_main
+        backyard_sub:
+          - rtsp://{FRIGATE_REOLINK_USER}:{FRIGATE_REOLINK_PASSWORD}@10.0.2.238:554/h264Preview_01_sub
+        entrance:
+          - rtsp://{FRIGATE_REOLINK_USER}:{FRIGATE_REOLINK_PASSWORD}@10.0.2.222:554/h264Preview_01_main
+        entrance_sub:
+          - rtsp://{FRIGATE_REOLINK_USER}:{FRIGATE_REOLINK_PASSWORD}@10.0.2.222:554/h264Preview_01_sub
+        living_room:
+          - rtsp://wyze-bridge.home.svc.cluster.local:8554/living-room-ceiling
+        living_room_sub:
+          - rtsp://wyze-bridge.home.svc.cluster.local:8554/living-room-ceiling-sub
+        family_room:
+          - rtsp://wyze-bridge.home.svc.cluster.local:8554/family-room
+        family_room_sub:
+          - rtsp://wyze-bridge.home.svc.cluster.local:8554/family-room-sub
+
+    # Specify camera's
+    cameras:
+      backyard:
+        ffmpeg:
+          inputs:
+            - path: rtsp://localhost:8554/backyard
+              roles: ["record"]
+            - path: rtsp://localhost:8554/backyard_sub
+              roles: ["detect"]
+        detect:
+          width: 640
+          height: 360
+          fps: 10
+
+      entrance:
+        ffmpeg:
+          inputs:
+            - path: rtsp://localhost:8554/entrance
+              roles: ["record"]
+            - path: rtsp://localhost:8554/entrance_sub
+              roles: ["detect"]
+        detect:
+          width: 640
+          height: 360
+          fps: 10
+        zones:
+          parking_lot:
+            coordinates: 134,360,474,360,516,149,219,107,0,240
+        motion:
+          mask:
+            - 0,360,144,360,139,316,0,297
+            - 503,311,538,221,567,125,583,0,483,0,441,0
+            - 464,0,440,35,253,43,123,91,0,129,0,0
+            - 640,0,640,29,444,28,443,0
+
+      living_room:
+        ffmpeg:
+          inputs:
+            - path: rtsp://localhost:8554/living_room_sub
+              input_args: preset-rtsp-restream
+              roles: ["detect"]
+            - path: rtsp://localhost:8554/living_room
+              input_args: preset-rtsp-restream
+              roles: ["record"]
+        detect:
+          width: 640
+          height: 360
+          fps: 10
+
+      family_room:
+        ffmpeg:
+          inputs:
+            - path: rtsp://localhost:8554/family_room_sub
+              input_args: preset-rtsp-restream
+              roles: ["detect"]
+            - path: rtsp://localhost:8554/family_room
+              input_args: preset-rtsp-restream
+              roles: ["record"]
+        detect:
+          width: 640
+          height: 360
+          fps: 10
+kind: ConfigMap
+metadata:
+  annotations:
+    kustomize.toolkit.fluxcd.io/substitute: disabled
+  labels:
+    app.kubernetes.io/name: frigate
+    kustomize.toolkit.fluxcd.io/name: frigate
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: frigate-configmap
+  namespace: home
+

@bot-x-mod
Copy link
Contributor

bot-x-mod bot commented Dec 15, 2023

--- kubernetes/main HelmRelease: home/frigate StatefulSet: home/frigate

+++ kubernetes/main HelmRelease: home/frigate StatefulSet: home/frigate

@@ -1,128 +0,0 @@

----
-apiVersion: apps/v1
-kind: StatefulSet
-metadata:
-  name: frigate
-  labels:
-    app.kubernetes.io/component: main
-    app.kubernetes.io/instance: frigate
-    app.kubernetes.io/managed-by: Helm
-    app.kubernetes.io/name: frigate
-  annotations:
-    reloader.stakater.com/auto: 'true'
-spec:
-  revisionHistoryLimit: 3
-  replicas: 1
-  podManagementPolicy: OrderedReady
-  updateStrategy:
-    type: RollingUpdate
-  selector:
-    matchLabels:
-      app.kubernetes.io/component: main
-      app.kubernetes.io/name: frigate
-      app.kubernetes.io/instance: frigate
-  serviceName: frigate
-  template:
-    metadata:
-      labels:
-        app.kubernetes.io/component: main
-        app.kubernetes.io/instance: frigate
-        app.kubernetes.io/name: frigate
-    spec:
-      enableServiceLinks: true
-      serviceAccountName: default
-      automountServiceAccountToken: true
-      hostIPC: false
-      hostNetwork: false
-      hostPID: false
-      dnsPolicy: ClusterFirst
-      nodeSelector:
-        google.feature.node.kubernetes.io/coral: 'true'
-        intel.feature.node.kubernetes.io/gpu: 'true'
-      affinity:
-        podAntiAffinity:
-          requiredDuringSchedulingIgnoredDuringExecution:
-          - labelSelector:
-              matchExpressions:
-              - key: app.kubernetes.io/name
-                operator: In
-                values:
-                - plex
-            topologyKey: kubernetes.io/hostname
-      containers:
-      - env:
-        - name: LIBVA_DRIVER_NAME
-          value: i965
-        - name: TZ
-          value: America/Santiago
-        envFrom:
-        - secretRef:
-            name: frigate-secret
-        image: ghcr.io/blakeblackshear/frigate:0.13.0-beta6
-        livenessProbe:
-          failureThreshold: 3
-          httpGet:
-            path: /api/version
-            port: 5000
-          initialDelaySeconds: 0
-          periodSeconds: 10
-          timeoutSeconds: 1
-        name: main
-        readinessProbe:
-          failureThreshold: 3
-          httpGet:
-            path: /api/version
-            port: 5000
-          initialDelaySeconds: 0
-          periodSeconds: 10
-          timeoutSeconds: 1
-        resources:
-          limits:
-            gpu.intel.com/i915: 1
-            memory: 10Gi
-          requests:
-            cpu: 1000m
-            gpu.intel.com/i915: 1
-            memory: 2Gi
-        securityContext:
-          privileged: true
-        volumeMounts:
-        - mountPath: /dev/shm
-          name: cache
-        - mountPath: /data
-          name: config
-        - mountPath: /config/config.yml
-          name: config-file
-          readOnly: true
-          subPath: config.yml
-        - mountPath: /media
-          name: media
-        - mountPath: /dev/bus/usb
-          name: usb
-      volumes:
-      - emptyDir:
-          medium: Memory
-          sizeLimit: 2Gi
-        name: cache
-      - configMap:
-          name: frigate-configmap
-        name: config-file
-      - name: media
-        nfs:
-          path: /volume1/frigate
-          server: 10.2.1.50
-      - hostPath:
-          path: /dev/bus/usb
-          type: Directory
-        name: usb
-  volumeClaimTemplates:
-  - metadata:
-      name: config
-    spec:
-      accessModes:
-      - ReadWriteOnce
-      resources:
-        requests:
-          storage: 5Gi
-      storageClassName: ceph-block
-
--- kubernetes/main HelmRelease: home/frigate Ingress: home/frigate

+++ kubernetes/main HelmRelease: home/frigate Ingress: home/frigate

@@ -7,14 +7,16 @@

     app.kubernetes.io/instance: frigate
     app.kubernetes.io/managed-by: Helm
     app.kubernetes.io/name: frigate
   annotations:
     external-dns.alpha.kubernetes.io/target: ingress.donoso.family
     hajimari.io/icon: mdi:cctv
+    nginx.ingress.kubernetes.io/auth-signin: https://auth.donoso.family/oauth2/start
+    nginx.ingress.kubernetes.io/auth-url: https://auth.donoso.family/oauth2/auth
 spec:
-  ingressClassName: nginx
+  ingressClassName: external
   tls:
   - hosts:
     - frigate.donoso.family
   rules:
   - host: frigate.donoso.family
     http:
--- kubernetes/main HelmRelease: home/frigate Deployment: home/frigate

+++ kubernetes/main HelmRelease: home/frigate Deployment: home/frigate

@@ -0,0 +1,119 @@

+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: frigate
+  labels:
+    app.kubernetes.io/component: main
+    app.kubernetes.io/instance: frigate
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: frigate
+  annotations:
+    reloader.stakater.com/auto: 'true'
+spec:
+  revisionHistoryLimit: 3
+  replicas: 1
+  strategy:
+    type: Recreate
+  selector:
+    matchLabels:
+      app.kubernetes.io/component: main
+      app.kubernetes.io/name: frigate
+      app.kubernetes.io/instance: frigate
+  template:
+    metadata:
+      labels:
+        app.kubernetes.io/component: main
+        app.kubernetes.io/instance: frigate
+        app.kubernetes.io/name: frigate
+    spec:
+      enableServiceLinks: true
+      serviceAccountName: default
+      automountServiceAccountToken: true
+      hostIPC: false
+      hostNetwork: false
+      hostPID: false
+      dnsPolicy: ClusterFirst
+      nodeSelector:
+        google.feature.node.kubernetes.io/coral: 'true'
+        intel.feature.node.kubernetes.io/gpu: 'true'
+      affinity:
+        podAntiAffinity:
+          requiredDuringSchedulingIgnoredDuringExecution:
+          - labelSelector:
+              matchExpressions:
+              - key: app.kubernetes.io/name
+                operator: In
+                values:
+                - plex
+            topologyKey: kubernetes.io/hostname
+      containers:
+      - env:
+        - name: LIBVA_DRIVER_NAME
+          value: i965
+        - name: TZ
+          value: America/Santiago
+        envFrom:
+        - secretRef:
+            name: frigate-secret
+        image: ghcr.io/blakeblackshear/frigate:0.13.0-beta6
+        livenessProbe:
+          failureThreshold: 3
+          httpGet:
+            path: /api/version
+            port: 5000
+          initialDelaySeconds: 0
+          periodSeconds: 10
+          timeoutSeconds: 1
+        name: main
+        readinessProbe:
+          failureThreshold: 3
+          httpGet:
+            path: /api/version
+            port: 5000
+          initialDelaySeconds: 0
+          periodSeconds: 10
+          timeoutSeconds: 1
+        resources:
+          limits:
+            gpu.intel.com/i915: '1'
+            memory: 8Gi
+          requests:
+            cpu: 1000m
+            gpu.intel.com/i915: '1'
+            memory: 2Gi
+        securityContext:
+          privileged: true
+        volumeMounts:
+        - mountPath: /dev/shm
+          name: cache
+        - mountPath: /data
+          name: config
+        - mountPath: /config/config.yml
+          name: config-file
+          readOnly: true
+          subPath: config.yml
+        - mountPath: /media
+          name: media
+        - mountPath: /dev/bus/usb
+          name: usb
+      volumes:
+      - emptyDir:
+          medium: Memory
+          sizeLimit: 4Gi
+        name: cache
+      - name: config
+        persistentVolumeClaim:
+          claimName: config-frigate-0
+      - configMap:
+          name: frigate-configmap
+        name: config-file
+      - name: media
+        nfs:
+          path: /volume1/frigate
+          server: 10.2.1.50
+      - hostPath:
+          path: /dev/bus/usb
+          type: Directory
+        name: usb
+

@blackjid blackjid merged commit 052939e into main Dec 15, 2023
3 of 4 checks passed
@blackjid blackjid deleted the upgrade_frigate branch December 27, 2023 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant