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(kyverno): volsync policy #3250

Merged
merged 1 commit into from
Jan 3, 2025
Merged

feat(kyverno): volsync policy #3250

merged 1 commit into from
Jan 3, 2025

Conversation

buroa
Copy link
Owner

@buroa buroa commented Jan 2, 2025

No description provided.

@bot-blake bot-blake bot added area/kubernetes Changes made in the kubernetes directory area/taskfiles Changes made in the taskfiles directory labels Jan 2, 2025
@bot-blake
Copy link
Contributor

bot-blake bot commented Jan 2, 2025

--- kubernetes/apps/kyverno/kyverno/app Kustomization: flux-system/kyverno HelmRelease: kyverno/kyverno

+++ kubernetes/apps/kyverno/kyverno/app Kustomization: flux-system/kyverno HelmRelease: kyverno/kyverno

@@ -36,23 +36,69 @@

             resources:
             - pods
             verbs:
             - create
             - update
             - delete
+          - apiGroups:
+            - external-secrets.io
+            resources:
+            - externalsecrets
+            verbs:
+            - create
+            - update
+            - patch
+            - delete
+            - get
+            - list
+          - apiGroups:
+            - volsync.backube
+            resources:
+            - replicationsources
+            - replicationdestinations
+            verbs:
+            - create
+            - update
+            - patch
+            - delete
+            - get
+            - list
       replicas: 3
       serviceMonitor:
         enabled: true
     backgroundController:
       rbac:
         clusterRole:
           extraResources:
           - apiGroups:
             - ''
             resources:
             - pods
+            verbs:
+            - create
+            - update
+            - patch
+            - delete
+            - get
+            - list
+          - apiGroups:
+            - external-secrets.io
+            resources:
+            - externalsecrets
+            verbs:
+            - create
+            - update
+            - patch
+            - delete
+            - get
+            - list
+          - apiGroups:
+            - volsync.backube
+            resources:
+            - replicationsources
+            - replicationdestinations
             verbs:
             - create
             - update
             - patch
             - delete
             - get
--- kubernetes/apps/kyverno/kyverno/policies Kustomization: flux-system/kyverno-policies ClusterPolicy: kyverno/volsync

+++ kubernetes/apps/kyverno/kyverno/policies Kustomization: flux-system/kyverno-policies ClusterPolicy: kyverno/volsync

@@ -0,0 +1,199 @@

+---
+apiVersion: kyverno.io/v1
+kind: ClusterPolicy
+metadata:
+  annotations:
+    pod-policies.kyverno.io/autogen-controllers: none
+    policies.kyverno.io/category: Storage
+    policies.kyverno.io/description: This policy will automatically synchronize volumes
+      for all Pods with the volumeSynchronization set to true.
+    policies.kyverno.io/severity: low
+    policies.kyverno.io/subject: Pod
+    policies.kyverno.io/title: Volume Synchronization
+  labels:
+    app.kubernetes.io/name: kyverno-policies
+    kustomize.toolkit.fluxcd.io/name: kyverno-policies
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: volsync
+  namespace: kyverno
+spec:
+  rules:
+  - context:
+    - name: VOLSYNC_USER
+      variable:
+        jmesPath: to_number(@)
+        value: '{{ request.object.metadata.annotations."volsync.io/user" || ''568''
+          }}'
+    - name: VOLSYNC_GROUP
+      variable:
+        jmesPath: to_number(@)
+        value: '{{ request.object.metadata.annotations."volsync.io/group" || ''568''
+          }}'
+    - name: VOLSYNC_CACHE
+      variable:
+        jmesPath: to_string(@)
+        value: '{{ request.object.metadata.annotations."volsync.io/cache" || ''8Gi''
+          }}'
+    generate:
+      apiVersion: external-secrets.io/v1beta1
+      data:
+        spec:
+          dataFrom:
+          - extract:
+              key: volsync-restic-template
+          secretStoreRef:
+            kind: ClusterSecretStore
+            name: onepassword-connect
+          target:
+            creationPolicy: Owner
+            name: '{{ request.object.metadata.name }}-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 }}/{{ request.object.metadata.name
+                  }}
+              engineVersion: v2
+      generateExisting: true
+      kind: ExternalSecret
+      name: '{{ request.object.metadata.name }}-restic'
+      namespace: '{{ request.object.metadata.namespace }}'
+      synchronize: true
+    match:
+      resources:
+        kinds:
+        - PersistentVolumeClaim
+    name: volsync-external-secret
+    preconditions:
+      all:
+      - key: '{{ request.object.spec.dataSourceRef.kind }}'
+        operator: Equals
+        value: ReplicationDestination
+      - key: '{{ request.object.spec.dataSourceRef.apiGroup }}'
+        operator: Equals
+        value: volsync.backube
+      - key: '{{ request.object.spec.dataSourceRef.name }}'
+        operator: Equals
+        value: '{{ request.object.metadata.name }}'
+  - context:
+    - name: VOLSYNC_USER
+      variable:
+        jmesPath: to_number(@)
+        value: '{{ request.object.metadata.annotations."volsync.io/user" || ''568''
+          }}'
+    - name: VOLSYNC_GROUP
+      variable:
+        jmesPath: to_number(@)
+        value: '{{ request.object.metadata.annotations."volsync.io/group" || ''568''
+          }}'
+    - name: VOLSYNC_CACHE
+      variable:
+        jmesPath: to_string(@)
+        value: '{{ request.object.metadata.annotations."volsync.io/cache" || ''8Gi''
+          }}'
+    generate:
+      apiVersion: volsync.backube/v1alpha1
+      data:
+        spec:
+          restic:
+            accessModes: '{{ request.object.spec.accessModes }}'
+            cacheAccessModes:
+            - ReadWriteOnce
+            cacheCapacity: '{{ VOLSYNC_CACHE }}'
+            cacheStorageClassName: openebs-hostpath
+            capacity: '{{ request.object.spec.resources.requests.storage }}'
+            copyMethod: Snapshot
+            moverSecurityContext:
+              fsGroup: '{{ VOLSYNC_GROUP }}'
+              runAsGroup: '{{ VOLSYNC_GROUP }}'
+              runAsUser: '{{ VOLSYNC_USER }}'
+            repository: '{{ request.object.metadata.name }}-restic-secret'
+            storageClassName: '{{ request.object.spec.storageClassName }}'
+            volumeSnapshotClassName: csi-{{ request.object.spec.storageClassName }}
+          trigger:
+            manual: restore-once
+      generateExisting: true
+      kind: ReplicationDestination
+      name: '{{ request.object.metadata.name }}'
+      namespace: '{{ request.object.metadata.namespace }}'
+      synchronize: true
+    match:
+      resources:
+        kinds:
+        - PersistentVolumeClaim
+    name: volsync-replication-destination
+    preconditions:
+      all:
+      - key: '{{ request.object.spec.dataSourceRef.kind }}'
+        operator: Equals
+        value: ReplicationDestination
+      - key: '{{ request.object.spec.dataSourceRef.apiGroup }}'
+        operator: Equals
+        value: volsync.backube
+      - key: '{{ request.object.spec.dataSourceRef.name }}'
+        operator: Equals
+        value: '{{ request.object.metadata.name }}'
+  - context:
+    - name: VOLSYNC_USER
+      variable:
+        jmesPath: to_number(@)
+        value: '{{ request.object.metadata.annotations."volsync.io/user" || ''568''
+          }}'
+    - name: VOLSYNC_GROUP
+      variable:
+        jmesPath: to_number(@)
+        value: '{{ request.object.metadata.annotations."volsync.io/group" || ''568''
+          }}'
+    - name: VOLSYNC_CACHE
+      variable:
+        jmesPath: to_string(@)
+        value: '{{ request.object.metadata.annotations."volsync.io/cache" || ''8Gi''
+          }}'
+    generate:
+      apiVersion: volsync.backube/v1alpha1
+      data:
+        spec:
+          restic:
+            accessModes: '{{ request.object.spec.accessModes }}'
+            cacheAccessModes:
+            - ReadWriteOnce
+            cacheCapacity: '{{ VOLSYNC_CACHE }}'
+            cacheStorageClassName: openebs-hostpath
+            copyMethod: Snapshot
+            moverSecurityContext:
+              fsGroup: '{{ VOLSYNC_GROUP }}'
+              runAsGroup: '{{ VOLSYNC_GROUP }}'
+              runAsUser: '{{ VOLSYNC_USER }}'
+            pruneIntervalDays: 14
+            repository: '{{ request.object.metadata.name }}-restic-secret'
+            retain:
+              daily: 7
+              hourly: 24
+            storageClassName: '{{ request.object.spec.storageClassName }}'
+            volumeSnapshotClassName: csi-{{ request.object.spec.storageClassName }}
+          sourcePVC: '{{ request.object.metadata.name }}'
+          trigger:
+            schedule: 0 * * * *
+      generateExisting: true
+      kind: ReplicationSource
+      name: '{{ request.object.metadata.name }}'
+      namespace: '{{ request.object.metadata.namespace }}'
+      synchronize: true
+    match:
+      resources:
+        kinds:
+        - PersistentVolumeClaim
+    name: volsync-replication-source
+    preconditions:
+      all:
+      - key: '{{ request.object.spec.dataSourceRef.kind }}'
+        operator: Equals
+        value: ReplicationDestination
+      - key: '{{ request.object.spec.dataSourceRef.apiGroup }}'
+        operator: Equals
+        value: volsync.backube
+      - key: '{{ request.object.spec.dataSourceRef.name }}'
+        operator: Equals
+        value: '{{ request.object.metadata.name }}'
+
--- kubernetes/apps/media/sabnzbd/app Kustomization: flux-system/sabnzbd ExternalSecret: media/sabnzbd-restic

+++ kubernetes/apps/media/sabnzbd/app Kustomization: flux-system/sabnzbd ExternalSecret: media/sabnzbd-restic

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

----
-apiVersion: external-secrets.io/v1beta1
-kind: ExternalSecret
-metadata:
-  labels:
-    app.kubernetes.io/name: sabnzbd
-    kustomize.toolkit.fluxcd.io/name: sabnzbd
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: sabnzbd-restic
-  namespace: media
-spec:
-  dataFrom:
-  - extract:
-      key: volsync-restic-template
-  secretStoreRef:
-    kind: ClusterSecretStore
-    name: onepassword-connect
-  target:
-    creationPolicy: Owner
-    name: sabnzbd-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 }}/sabnzbd'
-      engineVersion: v2
-
--- kubernetes/apps/media/sabnzbd/app Kustomization: flux-system/sabnzbd ReplicationDestination: media/sabnzbd

+++ kubernetes/apps/media/sabnzbd/app Kustomization: flux-system/sabnzbd ReplicationDestination: media/sabnzbd

@@ -1,30 +0,0 @@

----
-apiVersion: volsync.backube/v1alpha1
-kind: ReplicationDestination
-metadata:
-  labels:
-    app.kubernetes.io/name: sabnzbd
-    kustomize.toolkit.fluxcd.io/name: sabnzbd
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: sabnzbd
-  namespace: media
-spec:
-  restic:
-    accessModes:
-    - ReadWriteOnce
-    cacheAccessModes:
-    - ReadWriteOnce
-    cacheCapacity: 8Gi
-    cacheStorageClassName: openebs-hostpath
-    capacity: 2Gi
-    copyMethod: Snapshot
-    moverSecurityContext:
-      fsGroup: 568
-      runAsGroup: 568
-      runAsUser: 568
-    repository: sabnzbd-restic-secret
-    storageClassName: ceph-block
-    volumeSnapshotClassName: csi-ceph-block
-  trigger:
-    manual: restore-once
-
--- kubernetes/apps/media/sabnzbd/app Kustomization: flux-system/sabnzbd ReplicationSource: media/sabnzbd

+++ kubernetes/apps/media/sabnzbd/app Kustomization: flux-system/sabnzbd ReplicationSource: media/sabnzbd

@@ -1,35 +0,0 @@

----
-apiVersion: volsync.backube/v1alpha1
-kind: ReplicationSource
-metadata:
-  labels:
-    app.kubernetes.io/name: sabnzbd
-    kustomize.toolkit.fluxcd.io/name: sabnzbd
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: sabnzbd
-  namespace: media
-spec:
-  restic:
-    accessModes:
-    - ReadWriteOnce
-    cacheAccessModes:
-    - ReadWriteOnce
-    cacheCapacity: 8Gi
-    cacheStorageClassName: openebs-hostpath
-    copyMethod: Snapshot
-    moverSecurityContext:
-      fsGroup: 568
-      runAsGroup: 568
-      runAsUser: 568
-    pruneIntervalDays: 7
-    repository: sabnzbd-restic-secret
-    retain:
-      daily: 7
-      hourly: 24
-      weekly: 5
-    storageClassName: ceph-block
-    volumeSnapshotClassName: csi-ceph-block
-  sourcePVC: sabnzbd
-  trigger:
-    schedule: 15 */8 * * *
-
--- kubernetes/apps/media/plex/app Kustomization: flux-system/plex ExternalSecret: media/plex-restic

+++ kubernetes/apps/media/plex/app Kustomization: flux-system/plex ExternalSecret: media/plex-restic

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

----
-apiVersion: external-secrets.io/v1beta1
-kind: ExternalSecret
-metadata:
-  labels:
-    app.kubernetes.io/name: plex
-    kustomize.toolkit.fluxcd.io/name: plex
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: plex-restic
-  namespace: media
-spec:
-  dataFrom:
-  - extract:
-      key: volsync-restic-template
-  secretStoreRef:
-    kind: ClusterSecretStore
-    name: onepassword-connect
-  target:
-    creationPolicy: Owner
-    name: plex-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 }}/plex'
-      engineVersion: v2
-
--- kubernetes/apps/media/plex/app Kustomization: flux-system/plex ReplicationDestination: media/plex

+++ kubernetes/apps/media/plex/app Kustomization: flux-system/plex ReplicationDestination: media/plex

@@ -1,30 +0,0 @@

----
-apiVersion: volsync.backube/v1alpha1
-kind: ReplicationDestination
-metadata:
-  labels:
-    app.kubernetes.io/name: plex
-    kustomize.toolkit.fluxcd.io/name: plex
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: plex
-  namespace: media
-spec:
-  restic:
-    accessModes:
-    - ReadWriteOnce
-    cacheAccessModes:
-    - ReadWriteOnce
-    cacheCapacity: 8Gi
-    cacheStorageClassName: openebs-hostpath
-    capacity: 50Gi
-    copyMethod: Snapshot
-    moverSecurityContext:
-      fsGroup: 568
-      runAsGroup: 568
-      runAsUser: 568
-    repository: plex-restic-secret
-    storageClassName: ceph-block
-    volumeSnapshotClassName: csi-ceph-block
-  trigger:
-    manual: restore-once
-
--- kubernetes/apps/media/plex/app Kustomization: flux-system/plex ReplicationSource: media/plex

+++ kubernetes/apps/media/plex/app Kustomization: flux-system/plex ReplicationSource: media/plex

@@ -1,35 +0,0 @@

----
-apiVersion: volsync.backube/v1alpha1
-kind: ReplicationSource
-metadata:
-  labels:
-    app.kubernetes.io/name: plex
-    kustomize.toolkit.fluxcd.io/name: plex
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: plex
-  namespace: media
-spec:
-  restic:
-    accessModes:
-    - ReadWriteOnce
-    cacheAccessModes:
-    - ReadWriteOnce
-    cacheCapacity: 8Gi
-    cacheStorageClassName: openebs-hostpath
-    copyMethod: Snapshot
-    moverSecurityContext:
-      fsGroup: 568
-      runAsGroup: 568
-      runAsUser: 568
-    pruneIntervalDays: 7
-    repository: plex-restic-secret
-    retain:
-      daily: 7
-      hourly: 24
-      weekly: 5
-    storageClassName: ceph-block
-    volumeSnapshotClassName: csi-ceph-block
-  sourcePVC: plex
-  trigger:
-    schedule: 15 */8 * * *
-
--- kubernetes/apps/media/qbittorrent/app Kustomization: flux-system/qbittorrent ExternalSecret: media/qbittorrent-restic

+++ kubernetes/apps/media/qbittorrent/app Kustomization: flux-system/qbittorrent ExternalSecret: media/qbittorrent-restic

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

----
-apiVersion: external-secrets.io/v1beta1
-kind: ExternalSecret
-metadata:
-  labels:
-    app.kubernetes.io/name: qbittorrent
-    kustomize.toolkit.fluxcd.io/name: qbittorrent
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: qbittorrent-restic
-  namespace: media
-spec:
-  dataFrom:
-  - extract:
-      key: volsync-restic-template
-  secretStoreRef:
-    kind: ClusterSecretStore
-    name: onepassword-connect
-  target:
-    creationPolicy: Owner
-    name: qbittorrent-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 }}/qbittorrent'
-      engineVersion: v2
-
--- kubernetes/apps/media/qbittorrent/app Kustomization: flux-system/qbittorrent ReplicationDestination: media/qbittorrent

+++ kubernetes/apps/media/qbittorrent/app Kustomization: flux-system/qbittorrent ReplicationDestination: media/qbittorrent

@@ -1,30 +0,0 @@

----
-apiVersion: volsync.backube/v1alpha1
-kind: ReplicationDestination
-metadata:
-  labels:
-    app.kubernetes.io/name: qbittorrent
-    kustomize.toolkit.fluxcd.io/name: qbittorrent
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: qbittorrent
-  namespace: media
-spec:
-  restic:
-    accessModes:
-    - ReadWriteMany
-    cacheAccessModes:
-    - ReadWriteOnce
-    cacheCapacity: 8Gi
-    cacheStorageClassName: openebs-hostpath
-    capacity: 2Gi
-    copyMethod: Snapshot
-    moverSecurityContext:
-      fsGroup: 568
-      runAsGroup: 568
-      runAsUser: 568
-    repository: qbittorrent-restic-secret
-    storageClassName: ceph-filesystem
-    volumeSnapshotClassName: csi-ceph-filesystem
-  trigger:
-    manual: restore-once
-
--- kubernetes/apps/media/qbittorrent/app Kustomization: flux-system/qbittorrent ReplicationSource: media/qbittorrent

+++ kubernetes/apps/media/qbittorrent/app Kustomization: flux-system/qbittorrent ReplicationSource: media/qbittorrent

@@ -1,35 +0,0 @@

----
-apiVersion: volsync.backube/v1alpha1
-kind: ReplicationSource
-metadata:
-  labels:
-    app.kubernetes.io/name: qbittorrent
-    kustomize.toolkit.fluxcd.io/name: qbittorrent
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: qbittorrent
-  namespace: media
-spec:
-  restic:
-    accessModes:
-    - ReadWriteMany
-    cacheAccessModes:
-    - ReadWriteOnce
-    cacheCapacity: 8Gi
-    cacheStorageClassName: openebs-hostpath
-    copyMethod: Snapshot
-    moverSecurityContext:
-      fsGroup: 568
-      runAsGroup: 568
-      runAsUser: 568
-    pruneIntervalDays: 7
-    repository: qbittorrent-restic-secret
-    retain:
-      daily: 7
-      hourly: 24
-      weekly: 5
-    storageClassName: ceph-filesystem
-    volumeSnapshotClassName: csi-ceph-filesystem
-  sourcePVC: qbittorrent
-  trigger:
-    schedule: 15 */8 * * *
-
--- kubernetes/apps/media/recyclarr/app Kustomization: flux-system/recyclarr ExternalSecret: media/recyclarr-restic

+++ kubernetes/apps/media/recyclarr/app Kustomization: flux-system/recyclarr ExternalSecret: media/recyclarr-restic

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

----
-apiVersion: external-secrets.io/v1beta1
-kind: ExternalSecret
-metadata:
-  labels:
-    app.kubernetes.io/name: recyclarr
-    kustomize.toolkit.fluxcd.io/name: recyclarr
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: recyclarr-restic
-  namespace: media
-spec:
-  dataFrom:
-  - extract:
-      key: volsync-restic-template
-  secretStoreRef:
-    kind: ClusterSecretStore
-    name: onepassword-connect
-  target:
-    creationPolicy: Owner
-    name: recyclarr-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 }}/recyclarr'
-      engineVersion: v2
-
--- kubernetes/apps/media/recyclarr/app Kustomization: flux-system/recyclarr ReplicationDestination: media/recyclarr

+++ kubernetes/apps/media/recyclarr/app Kustomization: flux-system/recyclarr ReplicationDestination: media/recyclarr

@@ -1,30 +0,0 @@

----
-apiVersion: volsync.backube/v1alpha1
-kind: ReplicationDestination
-metadata:
-  labels:
-    app.kubernetes.io/name: recyclarr
-    kustomize.toolkit.fluxcd.io/name: recyclarr
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: recyclarr
-  namespace: media
-spec:
-  restic:
-    accessModes:
-    - ReadWriteOnce
-    cacheAccessModes:
-    - ReadWriteOnce
-    cacheCapacity: 8Gi
-    cacheStorageClassName: openebs-hostpath
-    capacity: 2Gi
-    copyMethod: Snapshot
-    moverSecurityContext:
-      fsGroup: 568
-      runAsGroup: 568
-      runAsUser: 568
-    repository: recyclarr-restic-secret
-    storageClassName: ceph-block
-    volumeSnapshotClassName: csi-ceph-block
-  trigger:
-    manual: restore-once
-
--- kubernetes/apps/media/recyclarr/app Kustomization: flux-system/recyclarr ReplicationSource: media/recyclarr

+++ kubernetes/apps/media/recyclarr/app Kustomization: flux-system/recyclarr ReplicationSource: media/recyclarr

@@ -1,35 +0,0 @@

----
-apiVersion: volsync.backube/v1alpha1
-kind: ReplicationSource
-metadata:
-  labels:
-    app.kubernetes.io/name: recyclarr
-    kustomize.toolkit.fluxcd.io/name: recyclarr
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: recyclarr
-  namespace: media
-spec:
-  restic:
-    accessModes:
-    - ReadWriteOnce
-    cacheAccessModes:
-    - ReadWriteOnce
-    cacheCapacity: 8Gi
-    cacheStorageClassName: openebs-hostpath
-    copyMethod: Snapshot
-    moverSecurityContext:
-      fsGroup: 568
-      runAsGroup: 568
-      runAsUser: 568
-    pruneIntervalDays: 7
-    repository: recyclarr-restic-secret
-    retain:
-      daily: 7
-      hourly: 24
-      weekly: 5
-    storageClassName: ceph-block
-    volumeSnapshotClassName: csi-ceph-block
-  sourcePVC: recyclarr
-  trigger:
-    schedule: 15 */8 * * *
-
--- kubernetes/apps/media/bazarr/app Kustomization: flux-system/bazarr ExternalSecret: media/bazarr-restic

+++ kubernetes/apps/media/bazarr/app Kustomization: flux-system/bazarr ExternalSecret: media/bazarr-restic

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

----
-apiVersion: external-secrets.io/v1beta1
-kind: ExternalSecret
-metadata:
-  labels:
-    app.kubernetes.io/name: bazarr
-    kustomize.toolkit.fluxcd.io/name: bazarr
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: bazarr-restic
-  namespace: media
-spec:
-  dataFrom:
-  - extract:
-      key: volsync-restic-template
-  secretStoreRef:
-    kind: ClusterSecretStore
-    name: onepassword-connect
-  target:
-    creationPolicy: Owner
-    name: bazarr-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 }}/bazarr'
-      engineVersion: v2
-
--- kubernetes/apps/media/bazarr/app Kustomization: flux-system/bazarr ReplicationDestination: media/bazarr

+++ kubernetes/apps/media/bazarr/app Kustomization: flux-system/bazarr ReplicationDestination: media/bazarr

@@ -1,30 +0,0 @@

----
-apiVersion: volsync.backube/v1alpha1
-kind: ReplicationDestination
-metadata:
-  labels:
-    app.kubernetes.io/name: bazarr
-    kustomize.toolkit.fluxcd.io/name: bazarr
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: bazarr
-  namespace: media
-spec:
-  restic:
-    accessModes:
-    - ReadWriteOnce
-    cacheAccessModes:
-    - ReadWriteOnce
-    cacheCapacity: 8Gi
-    cacheStorageClassName: openebs-hostpath
-    capacity: 2Gi
-    copyMethod: Snapshot
-    moverSecurityContext:
-      fsGroup: 568
-      runAsGroup: 568
-      runAsUser: 568
-    repository: bazarr-restic-secret
-    storageClassName: ceph-block
-    volumeSnapshotClassName: csi-ceph-block
-  trigger:
-    manual: restore-once
-
--- kubernetes/apps/media/bazarr/app Kustomization: flux-system/bazarr ReplicationSource: media/bazarr

+++ kubernetes/apps/media/bazarr/app Kustomization: flux-system/bazarr ReplicationSource: media/bazarr

@@ -1,35 +0,0 @@

----
-apiVersion: volsync.backube/v1alpha1
-kind: ReplicationSource
-metadata:
-  labels:
-    app.kubernetes.io/name: bazarr
-    kustomize.toolkit.fluxcd.io/name: bazarr
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: bazarr
-  namespace: media
-spec:
-  restic:
-    accessModes:
-    - ReadWriteOnce
-    cacheAccessModes:
-    - ReadWriteOnce
-    cacheCapacity: 8Gi
-    cacheStorageClassName: openebs-hostpath
-    copyMethod: Snapshot
-    moverSecurityContext:
-      fsGroup: 568
-      runAsGroup: 568
-      runAsUser: 568
-    pruneIntervalDays: 7
-    repository: bazarr-restic-secret
-    retain:
-      daily: 7
-      hourly: 24
-      weekly: 5
-    storageClassName: ceph-block
-    volumeSnapshotClassName: csi-ceph-block
-  sourcePVC: bazarr
-  trigger:
-    schedule: 15 */8 * * *
-
--- kubernetes/apps/media/tautulli/app Kustomization: flux-system/tautulli ExternalSecret: media/tautulli-restic

+++ kubernetes/apps/media/tautulli/app Kustomization: flux-system/tautulli ExternalSecret: media/tautulli-restic

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

----
-apiVersion: external-secrets.io/v1beta1
-kind: ExternalSecret
-metadata:
-  labels:
-    app.kubernetes.io/name: tautulli
-    kustomize.toolkit.fluxcd.io/name: tautulli
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: tautulli-restic
-  namespace: media
-spec:
-  dataFrom:
-  - extract:
-      key: volsync-restic-template
-  secretStoreRef:
-    kind: ClusterSecretStore
-    name: onepassword-connect
-  target:
-    creationPolicy: Owner
-    name: tautulli-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 }}/tautulli'
-      engineVersion: v2
-
--- kubernetes/apps/media/tautulli/app Kustomization: flux-system/tautulli ReplicationDestination: media/tautulli

+++ kubernetes/apps/media/tautulli/app Kustomization: flux-system/tautulli ReplicationDestination: media/tautulli

@@ -1,30 +0,0 @@

----
-apiVersion: volsync.backube/v1alpha1
-kind: ReplicationDestination
-metadata:
-  labels:
-    app.kubernetes.io/name: tautulli
-    kustomize.toolkit.fluxcd.io/name: tautulli
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: tautulli
-  namespace: media
-spec:
-  restic:
-    accessModes:
-    - ReadWriteOnce
-    cacheAccessModes:
-    - ReadWriteOnce
-    cacheCapacity: 8Gi
-    cacheStorageClassName: openebs-hostpath
-    capacity: 5Gi
-    copyMethod: Snapshot
-    moverSecurityContext:
-      fsGroup: 568
-      runAsGroup: 568
-      runAsUser: 568
-    repository: tautulli-restic-secret
-    storageClassName: ceph-block
-    volumeSnapshotClassName: csi-ceph-block
-  trigger:
-    manual: restore-once
-
--- kubernetes/apps/media/tautulli/app Kustomization: flux-system/tautulli ReplicationSource: media/tautulli

+++ kubernetes/apps/media/tautulli/app Kustomization: flux-system/tautulli ReplicationSource: media/tautulli

@@ -1,35 +0,0 @@

----
-apiVersion: volsync.backube/v1alpha1
-kind: ReplicationSource
-metadata:
-  labels:
-    app.kubernetes.io/name: tautulli
-    kustomize.toolkit.fluxcd.io/name: tautulli
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: tautulli
-  namespace: media
-spec:
-  restic:
-    accessModes:
-    - ReadWriteOnce
-    cacheAccessModes:
-    - ReadWriteOnce
-    cacheCapacity: 8Gi
-    cacheStorageClassName: openebs-hostpath
-    copyMethod: Snapshot
-    moverSecurityContext:
-      fsGroup: 568
-      runAsGroup: 568
-      runAsUser: 568
-    pruneIntervalDays: 7
-    repository: tautulli-restic-secret
-    retain:
-      daily: 7
-      hourly: 24
-      weekly: 5
-    storageClassName: ceph-block
-    volumeSnapshotClassName: csi-ceph-block
-  sourcePVC: tautulli
-  trigger:
-    schedule: 15 */8 * * *
-
--- kubernetes/apps/media/overseerr/app Kustomization: flux-system/overseerr ExternalSecret: media/overseerr-restic

+++ kubernetes/apps/media/overseerr/app Kustomization: flux-system/overseerr ExternalSecret: media/overseerr-restic

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

----
-apiVersion: external-secrets.io/v1beta1
-kind: ExternalSecret
-metadata:
-  labels:
-    app.kubernetes.io/name: overseerr
-    kustomize.toolkit.fluxcd.io/name: overseerr
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: overseerr-restic
-  namespace: media
-spec:
-  dataFrom:
-  - extract:
-      key: volsync-restic-template
-  secretStoreRef:
-    kind: ClusterSecretStore
-    name: onepassword-connect
-  target:
-    creationPolicy: Owner
-    name: overseerr-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 }}/overseerr'
-      engineVersion: v2
-
--- kubernetes/apps/media/overseerr/app Kustomization: flux-system/overseerr ReplicationDestination: media/overseerr

+++ kubernetes/apps/media/overseerr/app Kustomization: flux-system/overseerr ReplicationDestination: media/overseerr

@@ -1,30 +0,0 @@

----
-apiVersion: volsync.backube/v1alpha1
-kind: ReplicationDestination
-metadata:
-  labels:
-    app.kubernetes.io/name: overseerr
-    kustomize.toolkit.fluxcd.io/name: overseerr
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: overseerr
-  namespace: media
-spec:
-  restic:
-    accessModes:
-    - ReadWriteOnce
-    cacheAccessModes:
-    - ReadWriteOnce
-    cacheCapacity: 8Gi
-    cacheStorageClassName: openebs-hostpath
-    capacity: 2Gi
-    copyMethod: Snapshot
-    moverSecurityContext:
-      fsGroup: 568
-      runAsGroup: 568
-      runAsUser: 568
-    repository: overseerr-restic-secret
-    storageClassName: ceph-block
-    volumeSnapshotClassName: csi-ceph-block
-  trigger:
-    manual: restore-once
-
--- kubernetes/apps/media/overseerr/app Kustomization: flux-system/overseerr ReplicationSource: media/overseerr

+++ kubernetes/apps/media/overseerr/app Kustomization: flux-system/overseerr ReplicationSource: media/overseerr

@@ -1,35 +0,0 @@

----
-apiVersion: volsync.backube/v1alpha1
-kind: ReplicationSource
-metadata:
-  labels:
-    app.kubernetes.io/name: overseerr
-    kustomize.toolkit.fluxcd.io/name: overseerr
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: overseerr
-  namespace: media
-spec:
-  restic:
-    accessModes:
-    - ReadWriteOnce
-    cacheAccessModes:
-    - ReadWriteOnce
-    cacheCapacity: 8Gi
-    cacheStorageClassName: openebs-hostpath
-    copyMethod: Snapshot
-    moverSecurityContext:
-      fsGroup: 568
-      runAsGroup: 568
-      runAsUser: 568
-    pruneIntervalDays: 7
-    repository: overseerr-restic-secret
-    retain:
-      daily: 7
-      hourly: 24
-      weekly: 5
-    storageClassName: ceph-block
-    volumeSnapshotClassName: csi-ceph-block
-  sourcePVC: overseerr
-  trigger:
-    schedule: 15 */8 * * *
-
--- kubernetes/apps/home/home-assistant/app Kustomization: flux-system/home-assistant ExternalSecret: home/home-assistant-restic

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

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

----
-apiVersion: external-secrets.io/v1beta1
-kind: ExternalSecret
-metadata:
-  labels:
-    app.kubernetes.io/name: home-assistant
-    kustomize.toolkit.fluxcd.io/name: home-assistant
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: home-assistant-restic
-  namespace: home
-spec:
-  dataFrom:
-  - extract:
-      key: volsync-restic-template
-  secretStoreRef:
-    kind: ClusterSecretStore
-    name: onepassword-connect
-  target:
-    creationPolicy: Owner
-    name: home-assistant-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 }}/home-assistant'
-      engineVersion: v2
-
--- kubernetes/apps/home/home-assistant/app Kustomization: flux-system/home-assistant ReplicationDestination: home/home-assistant

+++ kubernetes/apps/home/home-assistant/app Kustomization: flux-system/home-assistant ReplicationDestination: home/home-assistant

@@ -1,30 +0,0 @@

----
-apiVersion: volsync.backube/v1alpha1
-kind: ReplicationDestination
-metadata:
-  labels:
-    app.kubernetes.io/name: home-assistant
-    kustomize.toolkit.fluxcd.io/name: home-assistant
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: home-assistant
-  namespace: home
-spec:
-  restic:
-    accessModes:
-    - ReadWriteOnce
-    cacheAccessModes:
-    - ReadWriteOnce
-    cacheCapacity: 8Gi
-    cacheStorageClassName: openebs-hostpath
-    capacity: 5Gi
-    copyMethod: Snapshot
-    moverSecurityContext:
-      fsGroup: 568
-      runAsGroup: 568
-      runAsUser: 568
-    repository: home-assistant-restic-secret
-    storageClassName: ceph-block
-    volumeSnapshotClassName: csi-ceph-block
-  trigger:
-    manual: restore-once
-
--- kubernetes/apps/home/home-assistant/app Kustomization: flux-system/home-assistant ReplicationSource: home/home-assistant

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

@@ -1,35 +0,0 @@

----
-apiVersion: volsync.backube/v1alpha1
-kind: ReplicationSource
-metadata:
-  labels:
-    app.kubernetes.io/name: home-assistant
-    kustomize.toolkit.fluxcd.io/name: home-assistant
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: home-assistant
-  namespace: home
-spec:
-  restic:
-    accessModes:
-    - ReadWriteOnce
-    cacheAccessModes:
-    - ReadWriteOnce
-    cacheCapacity: 8Gi
-    cacheStorageClassName: openebs-hostpath
-    copyMethod: Snapshot
-    moverSecurityContext:
-      fsGroup: 568
-      runAsGroup: 568
-      runAsUser: 568
-    pruneIntervalDays: 7
-    repository: home-assistant-restic-secret
-    retain:
-      daily: 7
-      hourly: 24
-      weekly: 5
-    storageClassName: ceph-block
-    volumeSnapshotClassName: csi-ceph-block
-  sourcePVC: home-assistant
-  trigger:
-    schedule: 15 */8 * * *
-
--- kubernetes/apps/home/zigbee2mqtt/app Kustomization: flux-system/zigbee2mqtt ExternalSecret: home/zigbee2mqtt-restic

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

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

----
-apiVersion: external-secrets.io/v1beta1
-kind: ExternalSecret
-metadata:
-  labels:
-    app.kubernetes.io/name: zigbee2mqtt
-    kustomize.toolkit.fluxcd.io/name: zigbee2mqtt
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: zigbee2mqtt-restic
-  namespace: home
-spec:
-  dataFrom:
-  - extract:
-      key: volsync-restic-template
-  secretStoreRef:
-    kind: ClusterSecretStore
-    name: onepassword-connect
-  target:
-    creationPolicy: Owner
-    name: zigbee2mqtt-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 }}/zigbee2mqtt'
-      engineVersion: v2
-
--- kubernetes/apps/home/zigbee2mqtt/app Kustomization: flux-system/zigbee2mqtt ReplicationDestination: home/zigbee2mqtt

+++ kubernetes/apps/home/zigbee2mqtt/app Kustomization: flux-system/zigbee2mqtt ReplicationDestination: home/zigbee2mqtt

@@ -1,30 +0,0 @@

----
-apiVersion: volsync.backube/v1alpha1
-kind: ReplicationDestination
-metadata:
-  labels:
-    app.kubernetes.io/name: zigbee2mqtt
-    kustomize.toolkit.fluxcd.io/name: zigbee2mqtt
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: zigbee2mqtt
-  namespace: home
-spec:
-  restic:
-    accessModes:
-    - ReadWriteOnce
-    cacheAccessModes:
-    - ReadWriteOnce
-    cacheCapacity: 8Gi
-    cacheStorageClassName: openebs-hostpath
-    capacity: 1Gi
-    copyMethod: Snapshot
-    moverSecurityContext:
-      fsGroup: 568
-      runAsGroup: 568
-      runAsUser: 568
-    repository: zigbee2mqtt-restic-secret
-    storageClassName: ceph-block
-    volumeSnapshotClassName: csi-ceph-block
-  trigger:
-    manual: restore-once
-
--- kubernetes/apps/home/zigbee2mqtt/app Kustomization: flux-system/zigbee2mqtt ReplicationSource: home/zigbee2mqtt

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

@@ -1,35 +0,0 @@

----
-apiVersion: volsync.backube/v1alpha1
-kind: ReplicationSource
-metadata:
-  labels:
-    app.kubernetes.io/name: zigbee2mqtt
-    kustomize.toolkit.fluxcd.io/name: zigbee2mqtt
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: zigbee2mqtt
-  namespace: home
-spec:
-  restic:
-    accessModes:
-    - ReadWriteOnce
-    cacheAccessModes:
-    - ReadWriteOnce
-    cacheCapacity: 8Gi
-    cacheStorageClassName: openebs-hostpath
-    copyMethod: Snapshot
-    moverSecurityContext:
-      fsGroup: 568
-      runAsGroup: 568
-      runAsUser: 568
-    pruneIntervalDays: 7
-    repository: zigbee2mqtt-restic-secret
-    retain:
-      daily: 7
-      hourly: 24
-      weekly: 5
-    storageClassName: ceph-block
-    volumeSnapshotClassName: csi-ceph-block
-  sourcePVC: zigbee2mqtt
-  trigger:
-    schedule: 15 */8 * * *
-

@bot-blake
Copy link
Contributor

bot-blake bot commented Jan 2, 2025

--- HelmRelease: kyverno/kyverno ClusterRole: kyverno/kyverno:admission-controller:additional

+++ HelmRelease: kyverno/kyverno ClusterRole: kyverno/kyverno:admission-controller:additional

@@ -14,7 +14,30 @@

   resources:
   - pods
   verbs:
   - create
   - update
   - delete
+- apiGroups:
+  - external-secrets.io
+  resources:
+  - externalsecrets
+  verbs:
+  - create
+  - update
+  - patch
+  - delete
+  - get
+  - list
+- apiGroups:
+  - volsync.backube
+  resources:
+  - replicationsources
+  - replicationdestinations
+  verbs:
+  - create
+  - update
+  - patch
+  - delete
+  - get
+  - list
 
--- HelmRelease: kyverno/kyverno ClusterRole: kyverno/kyverno:background-controller:additional

+++ HelmRelease: kyverno/kyverno ClusterRole: kyverno/kyverno:background-controller:additional

@@ -17,7 +17,30 @@

   - create
   - update
   - patch
   - delete
   - get
   - list
+- apiGroups:
+  - external-secrets.io
+  resources:
+  - externalsecrets
+  verbs:
+  - create
+  - update
+  - patch
+  - delete
+  - get
+  - list
+- apiGroups:
+  - volsync.backube
+  resources:
+  - replicationsources
+  - replicationdestinations
+  verbs:
+  - create
+  - update
+  - patch
+  - delete
+  - get
+  - list
 

@buroa buroa force-pushed the buroa/volsync branch 6 times, most recently from 40cf874 to 58ef0a7 Compare January 3, 2025 13:35
@buroa buroa merged commit d88d86d into master Jan 3, 2025
6 checks passed
@buroa buroa deleted the buroa/volsync branch January 3, 2025 13:38
buroa added a commit that referenced this pull request Jan 3, 2025
buroa added a commit that referenced this pull request Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubernetes Changes made in the kubernetes directory area/taskfiles Changes made in the taskfiles directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant