Skip to content

Commit

Permalink
feat: adds volsync
Browse files Browse the repository at this point in the history
  • Loading branch information
axeII committed Sep 8, 2024
1 parent 14d760a commit 8034ee4
Show file tree
Hide file tree
Showing 9 changed files with 150 additions and 0 deletions.
7 changes: 7 additions & 0 deletions kubernetes/apps/volsync-system/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./namespace.yaml
- ./snapshot-controller/ks.yaml
- ./volsync/ks.yaml
7 changes: 7 additions & 0 deletions kubernetes/apps/volsync-system/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: volsync-system
labels:
kustomize.toolkit.fluxcd.io/prune: disabled
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: snapshot-controller
spec:
interval: 30m
chart:
spec:
chart: snapshot-controller
version: 3.0.6
sourceRef:
kind: HelmRepository
name: piraeus-charts
namespace: flux-system
install:
crds: CreateReplace
remediation:
retries: 3
upgrade:
cleanupOnFail: true
crds: CreateReplace
remediation:
strategy: rollback
retries: 3
values:
controller:
serviceMonitor:
create: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./helmrelease.yaml
20 changes: 20 additions & 0 deletions kubernetes/apps/volsync-system/snapshot-controller/ks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app snapshot-controller
namespace: flux-system
spec:
targetNamespace: volsync-system
commonMetadata:
labels:
app.kubernetes.io/name: *app
path: ./kubernetes/apps/volsync-system/snapshot-controller/app
prune: true
sourceRef:
kind: GitRepository
name: k8s-gitops
wait: true
interval: 30m
retryInterval: 1m
timeout: 5m
27 changes: 27 additions & 0 deletions kubernetes/apps/volsync-system/volsync/app/helmrelease.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: volsync
spec:
interval: 30m
chart:
spec:
chart: volsync
version: 0.10.0
sourceRef:
kind: HelmRepository
name: backube-charts
namespace: flux-system
install:
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
strategy: rollback
retries: 3
values:
manageCRDs: true
metrics:
disableAuth: true
6 changes: 6 additions & 0 deletions kubernetes/apps/volsync-system/volsync/app/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./helmrelease.yaml
- ./prometheusrule.yaml
27 changes: 27 additions & 0 deletions kubernetes/apps/volsync-system/volsync/app/prometheusrule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: volsync-rules
spec:
groups:
- name: volsync.rules
rules:
- alert: VolSyncComponentAbsent
annotations:
summary: VolSync component has disappeared from Prometheus target discovery.
expr: |
absent(up{job="volsync-metrics"})
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
22 changes: 22 additions & 0 deletions kubernetes/apps/volsync-system/volsync/ks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app volsync
namespace: flux-system
spec:
targetNamespace: volsync-system
commonMetadata:
labels:
app.kubernetes.io/name: *app
dependsOn:
- name: snapshot-controller
path: ./kubernetes/apps/volsync-system/volsync/app
prune: true
sourceRef:
kind: GitRepository
name: k8s-gitops
wait: true
interval: 30m
retryInterval: 1m
timeout: 5m

0 comments on commit 8034ee4

Please sign in to comment.