feat: Add volsync and snapshot-controller.

This commit is contained in:
2026-02-09 09:45:27 +01:00
parent 5a90c0c27f
commit e11ec69113
10 changed files with 191 additions and 2 deletions

View File

@@ -6,5 +6,5 @@ namespace: storage-system
resources:
- ./namespace.yaml
- ./openebs
# - ./snapshot-controller
# - ./volsync
- ./snapshot-controller
- ./volsync

View File

@@ -0,0 +1,15 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: snapshot-controller
spec:
path: ./kubernetes/apps/storage-system/snapshot-controller/app
sourceRef:
kind: GitRepository
name: flux-system
namespace: flux-system
targetNamespace: storage-system
interval: 10m
prune: true
wait: true

View File

@@ -0,0 +1,21 @@
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: snapshot-controller
spec:
interval: 10m
chartRef:
kind: OCIRepository
name: snapshot-controller
values:
controller:
enabled: true
replicaCount: 1
resources:
requests:
cpu: 20m
memory: 64Mi
limits:
memory: 128Mi

View File

@@ -0,0 +1,13 @@
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: OCIRepository
metadata:
name: snapshot-controller
spec:
url: oci://ghcr.io/piraeusdatastore/helm-charts/snapshot-controller
interval: 15m
ref: {tag: 5.0.2}
layerSelector:
mediaType: application/vnd.cncf.helm.chart.content.v1.tar+gzip
operation: copy

View File

@@ -0,0 +1,6 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./app.ks.yaml

View File

@@ -0,0 +1,15 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: volsync
spec:
path: ./kubernetes/apps/storage-system/volsync/app
sourceRef:
kind: GitRepository
name: flux-system
namespace: flux-system
targetNamespace: storage-system
interval: 10m
prune: true
wait: true

View File

@@ -0,0 +1,46 @@
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: volsync
spec:
interval: 10m
chartRef:
kind: OCIRepository
name: volsync
values:
manageCRDs: true
replicaCount: 1
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app.kubernetes.io/name: volsync
topologyKey: kubernetes.io/hostname
resources:
requests:
cpu: 20m
memory: 128Mi
limits:
cpu: null
memory: 256Mi
kube-rbac-proxy-resources:
requests:
cpu: 5m
memory: 64Mi
limits:
cpu: null
memory: 96Mi
metrics:
disableAuth: true
podSecurityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000

View File

@@ -0,0 +1,53 @@
---
apiVersion: admissionregistration.k8s.io/v1beta1
kind: MutatingAdmissionPolicyBinding
metadata:
name: volsync-mover-jitter
spec:
policyName: volsync-mover-jitter
---
apiVersion: admissionregistration.k8s.io/v1beta1
kind: MutatingAdmissionPolicy
metadata:
name: volsync-mover-jitter
spec:
matchConstraints:
resourceRules:
- apiGroups:
- batch
apiVersions:
- v1
operations:
- CREATE
- UPDATE
resources:
- jobs
matchConditions:
- name: has-volsync-job-name-prefix
expression: >-
object.metadata.name.startsWith("volsync-src-")
- name: has-volsync-created-by-labels
expression: >-
object.metadata.?labels["app.kubernetes.io/created-by"].orValue("") == "volsync"
failurePolicy: Fail
reinvocationPolicy: IfNeeded
mutations:
- patchType: JSONPatch
jsonPatch:
expression: >-
[
JSONPatch{
op: "add", path: "/spec/template/spec/initContainers",
value: []
},
JSONPatch{
op: "add", path: "/spec/template/spec/initContainers/-",
value: Object.spec.template.spec.initContainers{
name: "jitter",
image: "ghcr.io/home-operations/busybox:1.37.0@sha256:026ed7273270ec08f6902b4ae8334c23b473e5394bec3bbbdbfe580c710d50bc",
imagePullPolicy: "IfNotPresent",
command: ["sh", "-c", "sleep $(shuf -i 0-30 -n 1)"]
}
}
]

View File

@@ -0,0 +1,14 @@
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: OCIRepository
metadata:
name: volsync
spec:
url: oci://ghcr.io/home-operations/charts-mirror/volsync
interval: 15m
ref: {tag: 0.14.0}
layerSelector:
mediaType: application/vnd.cncf.helm.chart.content.v1.tar+gzip
operation: copy

View File

@@ -0,0 +1,6 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./app.ks.yaml