Skip to content

Commit

Permalink
Merge pull request #4298 from tyriis/feature/volsync
Browse files Browse the repository at this point in the history
feat(volsync): setup in kube-nas
  • Loading branch information
tyriis authored Jan 10, 2025
2 parents c7f9bc1 + c4b24e6 commit f4722e3
Show file tree
Hide file tree
Showing 11 changed files with 148 additions and 2 deletions.
7 changes: 7 additions & 0 deletions kubernetes/kube-nas/apps/backup-system/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- volsync/flux-sync.yaml
7 changes: 7 additions & 0 deletions kubernetes/kube-nas/apps/backup-system/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: backup-system
labels:
kustomize.toolkit.fluxcd.io/prune: disabled
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/helm.toolkit.fluxcd.io/helmrelease_v2.json
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: volsync
spec:
interval: 15m
chart:
spec:
chart: volsync
version: 0.11.0
sourceRef:
kind: HelmRepository
name: backube-charts
namespace: flux-system
maxHistory: 15
install:
createNamespace: true
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
retries: 3
uninstall:
keepHistory: false
values:
manageCRDs: true
metrics:
disableAuth: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./helm-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/monitoring.coreos.com/prometheusrule_v1.json
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: volsync-rules
namespace: volsync
spec:
groups:
- name: volsync.rules
rules:
- alert: VolSyncComponentAbsent
annotations:
summary: VolSync component has disappeared from Prometheus target discovery.
expr: |
absent(up{job=~".*volsync.*"} == 1)
for: 15m
labels:
severity: critical
- alert: VolSyncVolumeOutOfSync
annotations:
summary: >-
{{ $labels.obj_namespace }}/{{ $labels.obj_name }} volume
is out of sync.
expr: |
volsync_volume_out_of_sync == 1
for: 15m
labels:
severity: critical
24 changes: 24 additions & 0 deletions kubernetes/kube-nas/apps/backup-system/volsync/flux-sync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &appname volsync
namespace: flux-system
labels:
substitution.flux.home.arpa/enabled: "true"
spec:
commonMetadata:
labels:
app.kubernetes.io/name: *appname
targetNamespace: backup-system
dependsOn:
- name: snapshot-controller
interval: 10m
path: ./kubernetes/kube-nas/apps/backup-system/volsync/app
prune: true
wait: true
sourceRef:
kind: GitRepository
name: home-ops
timeout: 3m
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: kube-system
resources:
- ./helm-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: snapshot-controller
name: &appname snapshot-controller
namespace: flux-system
labels:
substitution.flux.home.arpa/enabled: "true"
spec:
commonMetadata:
labels:
app.kubernetes.io/name: *appname
targetNamespace: kube-tools
interval: 10m
path: ./kubernetes/kube-nas/apps/kube-tools/snapshot-controller/app
prune: true
Expand Down
25 changes: 25 additions & 0 deletions kubernetes/kube-nas/apps/openebs-system/openebs/flux-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,28 @@ spec:
wait: true
retryInterval: 1m
timeout: 5m

---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &appname openebs-volume-snapshot-class
namespace: flux-system
spec:
dependsOn:
- name: openebs
- name: snapshot-controller
targetNamespace: openebs-system
commonMetadata:
labels:
app.kubernetes.io/name: *appname
interval: 10m
path: ./kubernetes/kube-nas/apps/openebs-system/openebs/volume-snapshot-class
prune: false
sourceRef:
kind: GitRepository
name: home-ops
wait: true
retryInterval: 1m
timeout: 5m
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./volume-snapshot-class.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/snapshot.storage.k8s.io/volumesnapshotclass_v1.json
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
name: openebs-snapshot-class
driver: openebs.io/local
deletionPolicy: Delete

0 comments on commit f4722e3

Please sign in to comment.