diff --git a/README.md b/README.md index 29d99b6..dc52307 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ * [Rancher Local (k3s default)](#pv-local) * [NFS](#pv-nfs) * [Rancher Longhorn (distributed in local cluster) - MY FAVOURITE :-)](#pv-longhorn) + * [Custom StorageClass](#pv-longhorn-custom-storageclass) + * [Volume backups with S3 (compatible) storage](#pv-longhorn-s3-backup) * [Ingress controller](#ingress-controller) * [Disable Traefik-ingress](#disable-traefik-ingress) * [Enable NGINX-ingress with OCSP stapling](#enable-nginx-ingress) @@ -214,6 +216,57 @@ spec: * Debian: `apt install open-iscsi` * Install: https://rancher.com/docs/k3s/latest/en/storage/ +### Custom StorageClass +The following storageClass `longhorn-2r` will define 2 `replicas`, no `dataLocality` and EXT4 as filesystem: +``` +allowVolumeExpansion: true +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + annotations: + longhorn.io/last-applied-configmap: | + kind: StorageClass + apiVersion: storage.k8s.io/v1 + metadata: + name: longhorn-2r + annotations: + storageclass.kubernetes.io/is-default-class: "true" + provisioner: driver.longhorn.io + allowVolumeExpansion: true + reclaimPolicy: "Delete" + volumeBindingMode: Immediate + parameters: + numberOfReplicas: "2" + staleReplicaTimeout: "30" + fromBackup: "" + fsType: "ext4" + dataLocality: "disabled" + storageclass.kubernetes.io/is-default-class: "true" + name: longhorn-2r +parameters: + fromBackup: "" + fsType: ext4 + numberOfReplicas: "2" + staleReplicaTimeout: "30" + dataLocality: "disabled" +provisioner: driver.longhorn.io +reclaimPolicy: Delete +volumeBindingMode: Immediate +``` +### Volume backups with S3 (compatible) storage +If you do not want to expose your volume backups to public cloud (e.g. AWS), you need to provide a local S3 storage server. This can be easily done with [minio](https://longhorn.io/docs/1.2.2/snapshots-and-backups/backup-and-restore/set-backup-target/#set-up-a-local-testing-backupstore): +``` +apiVersion: v1 +kind: Secret +metadata: + name: s3-backup-secret + namespace: longhorn-system +type: Opaque +data: + AWS_ACCESS_KEY_ID: bG9uZ2hvcm4= # Base64: + AWS_SECRET_ACCESS_KEY: Qmx1YmIxMjM0IQ== # Base64: + AWS_ENDPOINTS: aHR0cHM6Ly95b3VyLnMzLmVuZHBvaW50 # Base64: +``` # Ingress controller ## Disable Traefik-ingress