From a645aace1084feb825ce1fbb189a08b6d7b03384 Mon Sep 17 00:00:00 2001 From: Gilles Mouchet Date: Fri, 7 Apr 2023 10:29:21 +0200 Subject: [PATCH] first commit --- README.md | 52 +++++++++++++++++++ longhorn-values.yaml | 26 ++++++++++ longhornbackups/Chart.yaml | 24 +++++++++ longhornbackups/longhorn-secret-values.yaml | 8 +++ .../templates/longhorn-secret.yaml | 23 ++++++++ 5 files changed, 133 insertions(+) create mode 100644 README.md create mode 100644 longhorn-values.yaml create mode 100644 longhornbackups/Chart.yaml create mode 100644 longhornbackups/longhorn-secret-values.yaml create mode 100644 longhornbackups/templates/longhorn-secret.yaml diff --git a/README.md b/README.md new file mode 100644 index 0000000..bc1fbfd --- /dev/null +++ b/README.md @@ -0,0 +1,52 @@ +# Longhorn + +Documentation : + +- +- +- +- + +## Installation de Longhorn + +- Il faut installer une release "stable" (1.4.1 en Mars 2023) : +- Modifier les fichier values, exemple avec la target de backup + +```bash +helm repo add longhorn https://charts.longhorn.io +helm repo update +helm search repo longhorn --versions + + +helm upgrade longhorn longhorn/longhorn \ +--install \ +--atomic \ +--cleanup-on-fail \ +--version 1.4.1 \ +--values=longhorn-values.yaml \ +--namespace longhorn-system \ +--create-namespace +``` + +```bash + +helm upgrade longhornbackups ./longhornbackups \ +--install \ +--atomic \ +--cleanup-on-fail \ +--values=./longhornbackups/longhorn-secret-values.yaml \ +--namespace longhorn-system \ +--create-namespace +``` + +## Connexion + +```bash +kubectl port-forward deployment/longhorn-ui 7000:8000 -n longhorn-system +``` + +Puis + +## Upgrade + +Voir , diff --git a/longhorn-values.yaml b/longhorn-values.yaml new file mode 100644 index 0000000..378a126 --- /dev/null +++ b/longhorn-values.yaml @@ -0,0 +1,26 @@ +persistence: + defaultClass: true + defaultClassReplicaCount: 2 + reclaimPolicy: Retain + defaultDataLocality: best-effort +defaultSettings: + defaultReplicaCount: 2 + upgradeChecker: true + #guaranteedEngineManagerCPU: 12 + guaranteedEngineManagerCPU: 1 + #guaranteedReplicaManagerCPU: 12 + guaranteedReplicaManagerCPU: 1 + replicaSoftAntiAffinity: false + allowVolumeCreationWithDegradedAvailability: false + #storageMinimalAvailablePercentage: 25 + storageMinimalAvailablePercentage: 1 + allowRecurringJobWhileVolumeDetached: true + backupTarget: s3://longhornbackups@ch-nyon/longhorn + backupTargetCredentialSecret: minio-sos-secret + priorityClass: "system-node-critical" +longhornManager: + priorityClass: "system-node-critical" +longhornDriver: + priorityClass: "system-node-critical" +longhornUI: + priorityClass: "system-cluster-critical" diff --git a/longhornbackups/Chart.yaml b/longhornbackups/Chart.yaml new file mode 100644 index 0000000..7a47018 --- /dev/null +++ b/longhornbackups/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: minio-secret +description: Secret for longhorn 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/longhornbackups/longhorn-secret-values.yaml b/longhornbackups/longhorn-secret-values.yaml new file mode 100644 index 0000000..5e3f5a5 --- /dev/null +++ b/longhornbackups/longhorn-secret-values.yaml @@ -0,0 +1,8 @@ +data: + # echo -n "longhorn-backups-user" | base64 + awsAccessKey: bG9uZ2hvcm4tYmFja3Vwcy11c2Vy + # echo -n "userPasswordAChanger" | base64 + awsSecretAccessKey: dXNlclBhc3N3b3JkQUNoYW5nZXI= + # echo -n http://:9000" | base64 + # dans cet exemple http://10.10.10.94:9000 + awsEndpoint: aHR0cDovLzEwLjEwLjEwLjk0OjkwMDA= diff --git a/longhornbackups/templates/longhorn-secret.yaml b/longhornbackups/templates/longhorn-secret.yaml new file mode 100644 index 0000000..8f8c0d7 --- /dev/null +++ b/longhornbackups/templates/longhorn-secret.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: Secret +metadata: + name: minio-sos-secret + namespace: longhorn-system +type: Opaque +data: + 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 }} + AWS_ENDPOINTS: {{ required ".Values.data.awsEndpoint entry is required!" .Values.data.awsEndpoint }} + #AWS_CERT: your base64 encoded custom CA certificate goes here + +#apiVersion: v1 +#kind: Secret +#metadata: +# name: minio-sos-secret +# namespace: longhorn-system +#type: Opaque +#data: +# AWS_ACCESS_KEY_ID: bG9uZ2hvcm4tYmFja3Vwcy11c2Vy +# AWS_SECRET_ACCESS_KEY: UGE1NXcwcmQ= +# AWS_ENDPOINTS: aHR0cDovLzEwLjEwLjEwLjk0OjkwMDA= +# #AWS_CERT: your base64 encoded custom CA certificate goes here