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(ring-mqtt): setup #4433

Merged
merged 2 commits into from
Feb 1, 2025
Merged

feat(ring-mqtt): setup #4433

merged 2 commits into from
Feb 1, 2025

Conversation

tyriis
Copy link
Owner

@tyriis tyriis commented Feb 1, 2025

No description provided.

@tyriis-automation
Copy link
Contributor

tyriis-automation bot commented Feb 1, 2025

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ EDITORCONFIG editorconfig-checker 5 0 0.02s
✅ REPOSITORY gitleaks yes no 2.92s
✅ YAML prettier 5 0 0.43s
✅ YAML yamllint 5 0 0.41s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

Copy link

sonarqubecloud bot commented Feb 1, 2025

@tyriis-automation
Copy link
Contributor

--- kubernetes/talos-flux/apps Kustomization: flux-system/apps-sync Kustomization: flux-system/ring-mqtt

+++ kubernetes/talos-flux/apps Kustomization: flux-system/apps-sync Kustomization: flux-system/ring-mqtt

@@ -0,0 +1,34 @@

+---
+apiVersion: kustomize.toolkit.fluxcd.io/v1
+kind: Kustomization
+metadata:
+  labels:
+    kustomize.toolkit.fluxcd.io/name: apps-sync
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+    substitution.flux.home.arpa/enabled: 'true'
+  name: ring-mqtt
+  namespace: flux-system
+spec:
+  commonMetadata:
+    labels:
+      app.kubernetes.io/name: ring-mqtt
+  decryption:
+    provider: sops
+    secretRef:
+      name: sops-age
+  interval: 10m
+  path: ./kubernetes/talos-flux/apps/home-automation/ring-mqtt/app
+  postBuild:
+    substituteFrom:
+    - kind: ConfigMap
+      name: cluster-settings
+    - kind: Secret
+      name: cluster-secrets
+  prune: true
+  sourceRef:
+    kind: GitRepository
+    name: home-ops
+  targetNamespace: home-automation
+  timeout: 5m
+  wait: false
+
--- kubernetes/talos-flux/apps/home-automation/ring-mqtt/app Kustomization: flux-system/ring-mqtt ExternalSecret: home-automation/ring-mqtt-config

+++ kubernetes/talos-flux/apps/home-automation/ring-mqtt/app Kustomization: flux-system/ring-mqtt ExternalSecret: home-automation/ring-mqtt-config

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

+---
+apiVersion: external-secrets.io/v1beta1
+kind: ExternalSecret
+metadata:
+  labels:
+    app.kubernetes.io/name: ring-mqtt
+    kustomize.toolkit.fluxcd.io/name: ring-mqtt
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: ring-mqtt-config
+  namespace: home-automation
+spec:
+  dataFrom:
+  - extract:
+      key: infra/techtales/home-automation/ring-mqtt
+  refreshInterval: 1m
+  secretStoreRef:
+    kind: ClusterSecretStore
+    name: vault-backend
+  target:
+    creationPolicy: Owner
+    name: ring-mqtt-config
+    template:
+      data:
+        config.json: '{{ .config.json }}'
+        ring-state.json: '{{ .ring-state.json }}'
+      engineVersion: v2
+
--- kubernetes/talos-flux/apps/home-automation/ring-mqtt/app Kustomization: flux-system/ring-mqtt HelmRelease: home-automation/ring-mqtt

+++ kubernetes/talos-flux/apps/home-automation/ring-mqtt/app Kustomization: flux-system/ring-mqtt HelmRelease: home-automation/ring-mqtt

@@ -0,0 +1,90 @@

+---
+apiVersion: helm.toolkit.fluxcd.io/v2
+kind: HelmRelease
+metadata:
+  labels:
+    app.kubernetes.io/name: ring-mqtt
+    kustomize.toolkit.fluxcd.io/name: ring-mqtt
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: ring-mqtt
+  namespace: home-automation
+spec:
+  chart:
+    spec:
+      chart: app-template
+      interval: 15m
+      sourceRef:
+        kind: HelmRepository
+        name: bjw-s-charts
+        namespace: flux-system
+      version: 3.6.1
+  install:
+    createNamespace: true
+    remediation:
+      retries: 3
+  interval: 15m
+  maxHistory: 15
+  uninstall:
+    keepHistory: false
+  upgrade:
+    cleanupOnFail: true
+    remediation:
+      retries: 3
+  values:
+    controllers:
+      ring-mqtt:
+        annotations:
+          reloader.stakater.com/auto: 'true'
+        containers:
+          app:
+            env:
+              TZ: Europe/Vienna
+            image:
+              repository: tsightler/ring-mqtt
+              tag: 5.8.0@sha256:43717ab265a9c97dbb1fc029bfcbc8925e82a0f6bc2b28280dfd673c7f902541
+            ports:
+            - containerPort: 8554
+              name: rtsp
+              protocol: TCP
+            probes:
+              liveness:
+                enabled: true
+              readiness:
+                enabled: true
+              startup:
+                enabled: true
+            securityContext:
+              allowPrivilegeEscalation: false
+              capabilities:
+                drop:
+                - ALL
+              readOnlyRootFilesystem: true
+        pod:
+          securityContext:
+            runAsGroup: 65534
+            runAsNonRoot: true
+            runAsUser: 65534
+    persistence:
+      credentials:
+        advancedMounts:
+          ring-mqtt:
+            config:
+            - path: /data/config.json
+              readOnly: true
+              subPath: config.json
+            - path: /data/ring-state.json
+              readOnly: true
+              subPath: ring-state.json
+        name: ring-mqtt-config
+        type: secret
+      data:
+        globalMounts:
+        - path: /data
+        type: emptyDir
+    service:
+      app:
+        controller: ring-mqtt
+        ports:
+          http:
+            port: 8554
+

@tyriis-automation
Copy link
Contributor

--- HelmRelease: home-automation/ring-mqtt Service: home-automation/ring-mqtt

+++ HelmRelease: home-automation/ring-mqtt Service: home-automation/ring-mqtt

@@ -0,0 +1,22 @@

+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: ring-mqtt
+  labels:
+    app.kubernetes.io/instance: ring-mqtt
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: ring-mqtt
+    app.kubernetes.io/service: ring-mqtt
+spec:
+  type: ClusterIP
+  ports:
+  - port: 8554
+    targetPort: 8554
+    protocol: TCP
+    name: http
+  selector:
+    app.kubernetes.io/component: ring-mqtt
+    app.kubernetes.io/instance: ring-mqtt
+    app.kubernetes.io/name: ring-mqtt
+
--- HelmRelease: home-automation/ring-mqtt Deployment: home-automation/ring-mqtt

+++ HelmRelease: home-automation/ring-mqtt Deployment: home-automation/ring-mqtt

@@ -0,0 +1,87 @@

+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: ring-mqtt
+  labels:
+    app.kubernetes.io/component: ring-mqtt
+    app.kubernetes.io/instance: ring-mqtt
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: ring-mqtt
+  annotations:
+    reloader.stakater.com/auto: 'true'
+spec:
+  revisionHistoryLimit: 3
+  replicas: 1
+  strategy:
+    type: Recreate
+  selector:
+    matchLabels:
+      app.kubernetes.io/component: ring-mqtt
+      app.kubernetes.io/name: ring-mqtt
+      app.kubernetes.io/instance: ring-mqtt
+  template:
+    metadata:
+      labels:
+        app.kubernetes.io/component: ring-mqtt
+        app.kubernetes.io/instance: ring-mqtt
+        app.kubernetes.io/name: ring-mqtt
+    spec:
+      enableServiceLinks: false
+      serviceAccountName: default
+      automountServiceAccountToken: true
+      securityContext:
+        runAsGroup: 65534
+        runAsNonRoot: true
+        runAsUser: 65534
+      hostIPC: false
+      hostNetwork: false
+      hostPID: false
+      dnsPolicy: ClusterFirst
+      containers:
+      - env:
+        - name: TZ
+          value: Europe/Vienna
+        image: tsightler/ring-mqtt:5.8.0@sha256:43717ab265a9c97dbb1fc029bfcbc8925e82a0f6bc2b28280dfd673c7f902541
+        livenessProbe:
+          failureThreshold: 3
+          initialDelaySeconds: 0
+          periodSeconds: 10
+          tcpSocket:
+            port: 8554
+          timeoutSeconds: 1
+        name: app
+        ports:
+        - containerPort: 8554
+          name: rtsp
+          protocol: TCP
+        readinessProbe:
+          failureThreshold: 3
+          initialDelaySeconds: 0
+          periodSeconds: 10
+          tcpSocket:
+            port: 8554
+          timeoutSeconds: 1
+        securityContext:
+          allowPrivilegeEscalation: false
+          capabilities:
+            drop:
+            - ALL
+          readOnlyRootFilesystem: true
+        startupProbe:
+          failureThreshold: 3
+          initialDelaySeconds: 0
+          periodSeconds: 10
+          tcpSocket:
+            port: 8554
+          timeoutSeconds: 1
+        volumeMounts:
+        - mountPath: /data
+          name: data
+      volumes:
+      - name: credentials
+        secret:
+          secretName: ring-mqtt-config
+      - emptyDir: {}
+        name: data
+

@tyriis tyriis merged commit dbee57d into main Feb 1, 2025
16 checks passed
@tyriis tyriis deleted the feature/ring-mqtt branch February 1, 2025 00:23
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