first commit

This commit is contained in:
Gilles Mouchet 2023-04-07 10:29:21 +02:00
commit a645aace10
5 changed files with 133 additions and 0 deletions

52
README.md Normal file
View File

@ -0,0 +1,52 @@
# Longhorn
Documentation :
- <https://longhorn.io/docs/1.2.4/deploy/install/install-with-helm/>
- <https://artifacthub.io/packages/helm/longhorn/longhorn>
- <https://longhorn.io/docs/1.3.0/best-practices/>
- <https://community.exoscale.com/documentation/sks/longhorn-exoscale-sks/#configuring-backup-to-exoscale-sos>
## Installation de Longhorn
- Il faut installer une release "stable" (1.4.1 en Mars 2023) : <https://github.com/longhorn/longhorn#release-status>
- 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 <http://127.0.0.1:7000>
## Upgrade
Voir <https://longhorn.io/docs/1.2.4/deploy/upgrade/>, <https://longhorn.io/docs/1.3.1/deploy/upgrade/>

26
longhorn-values.yaml Normal file
View File

@ -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"

View File

@ -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"

View File

@ -0,0 +1,8 @@
data:
# echo -n "longhorn-backups-user" | base64
awsAccessKey: bG9uZ2hvcm4tYmFja3Vwcy11c2Vy
# echo -n "userPasswordAChanger" | base64
awsSecretAccessKey: dXNlclBhc3N3b3JkQUNoYW5nZXI=
# echo -n http://<adresse_ip_du_serveur_sr>:9000" | base64
# dans cet exemple http://10.10.10.94:9000
awsEndpoint: aHR0cDovLzEwLjEwLjEwLjk0OjkwMDA=

View File

@ -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