From dab343ab623d8f3616d02fceb572a47e827add44 Mon Sep 17 00:00:00 2001 From: Gilles Mouchet Date: Sun, 19 Mar 2023 10:26:00 +0100 Subject: [PATCH] initial commit --- README.md | 37 +++++++++++++++++++ kube-backups/Chart.yaml | 24 ++++++++++++ .../templates/kube-velero-secret.yaml | 11 ++++++ kube-backups/velero-kube-values.yaml | 3 ++ velero-values.yaml | 28 ++++++++++++++ 5 files changed, 103 insertions(+) create mode 100644 README.md create mode 100644 kube-backups/Chart.yaml create mode 100644 kube-backups/templates/kube-velero-secret.yaml create mode 100644 kube-backups/velero-kube-values.yaml create mode 100644 velero-values.yaml diff --git a/README.md b/README.md new file mode 100644 index 0000000..9aac8a3 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# Velero +## Installation +### kube-velero-secret +``` +helm upgrade kube-backups ./kube-backups \ +--install \ +--atomic \ +--cleanup-on-fail \ +--values=./kube-backups/velero-kube-values.yaml \ +--namespace velero \ +--create-namespace +``` + +## Velero +``` +helm repo add vmware-tanzu https://vmware-tanzu.github.io/helm-charts/ +helm repo update +helm search repo vmware-tanzu +helm show values vmware-tanzu/velero + +helm upgrade velero vmware-tanzu/velero \ +--install \ +--atomic \ +--cleanup-on-fail \ +--values=velero-values.yaml \ +--namespace velero \ +--create-namespace +``` + +## Désinstallation + + helm uninstall velero -n velero + helm uninstall kube-backups -n velero + +## Changelog +### v1.0 - 2023-02-19 - GMo +- Version initiale diff --git a/kube-backups/Chart.yaml b/kube-backups/Chart.yaml new file mode 100644 index 0000000..8f2e1a0 --- /dev/null +++ b/kube-backups/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: kubebackups +description: Secret for kubernetes backup + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 1.0.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.0.0" diff --git a/kube-backups/templates/kube-velero-secret.yaml b/kube-backups/templates/kube-velero-secret.yaml new file mode 100644 index 0000000..3b10db3 --- /dev/null +++ b/kube-backups/templates/kube-velero-secret.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Secret +metadata: + name: kube-velero-secret + namespace: velero +type: Opaque +stringData: + cloud: | + [default] + aws_access_key_id={{ required ".Values.data.awsAccessKey entry is required!" .Values.data.awsAccessKey }} + aws_secret_access_key={{ required ".Values.data.awsSecretAccessKey entry is required!" .Values.data.awsSecretAccessKey }} diff --git a/kube-backups/velero-kube-values.yaml b/kube-backups/velero-kube-values.yaml new file mode 100644 index 0000000..1b2441a --- /dev/null +++ b/kube-backups/velero-kube-values.yaml @@ -0,0 +1,3 @@ +data: + awsSecretAccessKey: Pa55w0rd + awsAccessKey: k8s-user diff --git a/velero-values.yaml b/velero-values.yaml new file mode 100644 index 0000000..d99111d --- /dev/null +++ b/velero-values.yaml @@ -0,0 +1,28 @@ +snapshotsEnabled: false +configuration: + provider: aws + backupStorageLocation: + name: default + bucket: longhorn + config: + s3Url: http://10.10.10.94:9000/ + #s3Url: http://multi-srvc.gmotech.net:9000/ + s3ForcePathStyle: true + region: minio +credentials: + existingSecret: kube-velero-secret +schedules: + globalbackup: + disabled: false + schedule: "10 * * * *" # toutes les minutes 10 (01:10, 02:10, xx:10). + template: + ttl: "168h" # retention de la sauvegarde (168h / 24 = 7 jours) +metrics: + serviceMonitor: + enabled: false +initContainers: + - name: velero-plugin-for-aws + image: velero/velero-plugin-for-aws:v1.5.0 + volumeMounts: + - mountPath: /target + name: plugins