-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bot-blake
bot
added
area/kubernetes
Changes made in the kubernetes directory
area/taskfiles
Changes made in the taskfiles directory
labels
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 * * *
- |
--- 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
force-pushed
the
buroa/volsync
branch
6 times, most recently
from
January 3, 2025 13:35
40cf874
to
58ef0a7
Compare
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.