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: backups for data pipeline #340

Merged
merged 1 commit into from
Jan 9, 2025
Merged

feat: backups for data pipeline #340

merged 1 commit into from
Jan 9, 2025

Conversation

bo0tzz
Copy link
Member

@bo0tzz bo0tzz commented Jan 9, 2025

No description provided.

Copy link

github-actions bot commented Jan 9, 2025

--- kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/data-pipeline-vmetrics-backup-secrets

+++ kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/data-pipeline-vmetrics-backup-secrets

@@ -0,0 +1,25 @@

+---
+apiVersion: kustomize.toolkit.fluxcd.io/v1
+kind: Kustomization
+metadata:
+  labels:
+    kustomize.toolkit.fluxcd.io/name: cluster-apps
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: data-pipeline-vmetrics-backup-secrets
+  namespace: flux-system
+spec:
+  commonMetadata:
+    labels:
+      app.kubernetes.io/name: data-pipeline-vmetrics-backup-secrets
+  dependsOn:
+  - name: data-pipeline-vmetrics
+  interval: 30m
+  path: ./kubernetes/apps/pipelines/data/victoria-metrics/backup-secrets
+  prune: true
+  retryInterval: 1m
+  sourceRef:
+    kind: GitRepository
+    name: immich-kubernetes
+  timeout: 5m
+  wait: true
+
--- kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/data-pipeline-vmetrics-backup

+++ kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/data-pipeline-vmetrics-backup

@@ -0,0 +1,32 @@

+---
+apiVersion: kustomize.toolkit.fluxcd.io/v1
+kind: Kustomization
+metadata:
+  labels:
+    kustomize.toolkit.fluxcd.io/name: cluster-apps
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: data-pipeline-vmetrics-backup
+  namespace: flux-system
+spec:
+  commonMetadata:
+    labels:
+      app.kubernetes.io/name: data-pipeline-vmetrics-backup
+  dependsOn:
+  - name: vmetrics-backup-secrets
+  - name: data-pipeline-vmetrics-backup-secrets
+  interval: 30m
+  path: ./kubernetes/apps/pipelines/data/victoria-metrics/backup
+  postBuild:
+    substituteFrom:
+    - kind: Secret
+      name: data-pipeline-vmetrics-backup-bucket
+    - kind: Secret
+      name: victoriametrics-backup-secret
+  prune: true
+  retryInterval: 1m
+  sourceRef:
+    kind: GitRepository
+    name: immich-kubernetes
+  timeout: 5m
+  wait: true
+
--- kubernetes/apps/pipelines/data/victoria-metrics/app Kustomization: flux-system/data-pipeline-vmetrics HelmRelease: data/victoria-metrics

+++ kubernetes/apps/pipelines/data/victoria-metrics/app Kustomization: flux-system/data-pipeline-vmetrics HelmRelease: data/victoria-metrics

@@ -44,12 +44,14 @@

       create: false
     fullnameOverride: vmetrics-data
     grafana:
       enabled: false
     kube-state-metrics:
       enabled: false
+    kubeApiServer:
+      enabled: false
     kubeControllerManager:
       enabled: false
     kubeEtcd:
       enabled: false
     kubeScheduler:
       enabled: false
--- kubernetes/apps/pipelines/data/victoria-metrics/backup-secrets Kustomization: flux-system/data-pipeline-vmetrics-backup-secrets OnePasswordItem: flux-system/data-pipeline-vmetrics-backup-bucket

+++ kubernetes/apps/pipelines/data/victoria-metrics/backup-secrets Kustomization: flux-system/data-pipeline-vmetrics-backup-secrets OnePasswordItem: flux-system/data-pipeline-vmetrics-backup-bucket

@@ -0,0 +1,13 @@

+---
+apiVersion: onepassword.com/v1
+kind: OnePasswordItem
+metadata:
+  labels:
+    app.kubernetes.io/name: data-pipeline-vmetrics-backup-secrets
+    kustomize.toolkit.fluxcd.io/name: data-pipeline-vmetrics-backup-secrets
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: data-pipeline-vmetrics-backup-bucket
+  namespace: flux-system
+spec:
+  itemPath: vaults/Kubernetes/items/mich-cloudflare-r2-data-pipeline-vmetrics-backup-bucket
+
--- kubernetes/apps/pipelines/data/victoria-metrics/backup Kustomization: flux-system/data-pipeline-vmetrics-backup ReplicationSource: data/data-pipeline-vmetrics-backup

+++ kubernetes/apps/pipelines/data/victoria-metrics/backup Kustomization: flux-system/data-pipeline-vmetrics-backup ReplicationSource: data/data-pipeline-vmetrics-backup

@@ -0,0 +1,26 @@

+---
+apiVersion: volsync.backube/v1alpha1
+kind: ReplicationSource
+metadata:
+  labels:
+    app.kubernetes.io/name: data-pipeline-vmetrics-backup
+    kustomize.toolkit.fluxcd.io/name: data-pipeline-vmetrics-backup
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: data-pipeline-vmetrics-backup
+  namespace: data
+spec:
+  restic:
+    cacheAccessModes:
+    - ReadWriteOnce
+    cacheStorageClassName: zfs
+    copyMethod: Direct
+    pruneIntervalDays: 14
+    repository: data-pipeline-vmetrics-backup-secret
+    retain:
+      daily: 5
+      monthly: 2
+      weekly: 1
+  sourcePVC: vmsingle-vmetrics-data
+  trigger:
+    schedule: 0 18 * * *
+

Copy link

github-actions bot commented Jan 9, 2025

--- HelmRelease: data/victoria-metrics VMServiceScrape: data/vmetrics-data-kube-api-server

+++ HelmRelease: data/victoria-metrics VMServiceScrape: data/vmetrics-data-kube-api-server

@@ -1,27 +0,0 @@

----
-apiVersion: operator.victoriametrics.com/v1beta1
-kind: VMServiceScrape
-metadata:
-  name: vmetrics-data-kube-api-server
-  namespace: data
-  labels:
-    app.kubernetes.io/instance: victoria-metrics
-    app.kubernetes.io/managed-by: Helm
-    app.kubernetes.io/name: victoria-metrics-k8s-stack
-spec:
-  endpoints:
-  - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
-    port: https
-    scheme: https
-    tlsConfig:
-      caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
-      serverName: kubernetes
-  jobLabel: component
-  namespaceSelector:
-    matchNames:
-    - default
-  selector:
-    matchLabels:
-      component: apiserver
-      provider: kubernetes
-

@bo0tzz bo0tzz merged commit 70f8635 into main Jan 9, 2025
5 checks passed
@bo0tzz bo0tzz deleted the feat/data-pipeline-backups branch January 9, 2025 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants