mirror of
https://github.com/outbackdingo/cozystack.git
synced 2026-01-27 18:18:41 +00:00
linstor: add basic snapshot functionality
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
This commit is contained in:
@@ -174,7 +174,7 @@ releases:
|
||||
chart: cozy-linstor
|
||||
namespace: cozy-linstor
|
||||
privileged: true
|
||||
dependsOn: [piraeus-operator,cilium,cert-manager]
|
||||
dependsOn: [piraeus-operator,cilium,cert-manager,snapshot-controller]
|
||||
|
||||
- name: telepresence
|
||||
releaseName: traffic-manager
|
||||
|
||||
@@ -205,7 +205,7 @@ releases:
|
||||
chart: cozy-linstor
|
||||
namespace: cozy-linstor
|
||||
privileged: true
|
||||
dependsOn: [piraeus-operator,cilium,kubeovn,cert-manager]
|
||||
dependsOn: [piraeus-operator,cilium,kubeovn,cert-manager,snapshot-controller]
|
||||
|
||||
- name: snapshot-controller
|
||||
releaseName: snapshot-controller
|
||||
|
||||
15
packages/system/linstor/templates/plunger/configmap.yaml
Normal file
15
packages/system/linstor/templates/plunger/configmap.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: linstor-plunger
|
||||
namespace: cozy-linstor
|
||||
data:
|
||||
plunger.sh: |
|
||||
#!/bin/bash
|
||||
set -e
|
||||
while true; do
|
||||
# workaround for https://github.com/LINBIT/linstor-server/issues/437
|
||||
linstor -m s l | jq -r '.[][] | select(.flags | contains(["DELETE"])) | "linstor snapshot delete \(.resource_name) \(.name)"' | sh -x
|
||||
sleep 1m
|
||||
done
|
||||
52
packages/system/linstor/templates/plunger/plunger.yaml
Normal file
52
packages/system/linstor/templates/plunger/plunger.yaml
Normal file
@@ -0,0 +1,52 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: linstor-plunger
|
||||
namespace: cozy-linstor
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: linstor-plunger
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: linstor-plunger
|
||||
annotations:
|
||||
checksum/config: {{ include (print $.Template.BasePath "/plunger/configmap.yaml") . | sha256sum }}
|
||||
spec:
|
||||
containers:
|
||||
- name: plunger
|
||||
image: quay.io/piraeusdatastore/piraeus-server:v1.29.2
|
||||
command: ["/bin/bash", "/scripts/plunger.sh"]
|
||||
volumeMounts:
|
||||
- mountPath: /etc/linstor/client
|
||||
name: client-tls
|
||||
readOnly: true
|
||||
- mountPath: /etc/linstor
|
||||
name: etc-linstor
|
||||
readOnly: true
|
||||
- mountPath: /scripts
|
||||
name: script-volume
|
||||
readOnly: true
|
||||
enableServiceLinks: false
|
||||
serviceAccountName: linstor-controller
|
||||
tolerations:
|
||||
- effect: NoSchedule
|
||||
key: drbd.linbit.com/lost-quorum
|
||||
- effect: NoSchedule
|
||||
key: drbd.linbit.com/force-io-error
|
||||
volumes:
|
||||
- name: client-tls
|
||||
projected:
|
||||
sources:
|
||||
- secret:
|
||||
name: linstor-client-tls
|
||||
- name: etc-linstor
|
||||
configMap:
|
||||
name: linstor-controller-config
|
||||
- name: script-volume
|
||||
configMap:
|
||||
name: linstor-plunger
|
||||
defaultMode: 0755
|
||||
@@ -0,0 +1,8 @@
|
||||
apiVersion: snapshot.storage.k8s.io/v1
|
||||
kind: VolumeSnapshotClass
|
||||
metadata:
|
||||
annotations:
|
||||
snapshot.storage.kubernetes.io/is-default-class: "true"
|
||||
name: linstor-snapshots
|
||||
driver: linstor.csi.linbit.com
|
||||
deletionPolicy: Delete
|
||||
Reference in New Issue
Block a user