Sync with Longhorn manager

commit 53203078833122cf1544e4145bf12ecec4e7d097
Author: Sheng Yang <sheng.yang@rancher.com>
Date:   Sun Dec 6 10:25:22 2020 -0800

    deploy: add iscsi deploy helper

    Signed-off-by: Sheng Yang <sheng.yang@rancher.com>

Signed-off-by: Sheng Yang <sheng.yang@rancher.com>
This commit is contained in:
Sheng Yang 2020-12-06 10:27:46 -08:00 committed by Sheng Yang
parent 791d63c5e3
commit 08e1522f6e
18 changed files with 444 additions and 82 deletions

View File

@ -1,8 +1,10 @@
longhornio/longhorn-engine:v1.0.2 longhornio/longhorn-engine:master
longhornio/longhorn-instance-manager:v1_20200514 longhornio/longhorn-instance-manager:v1_20201021
longhornio/longhorn-manager:v1.0.2 longhornio/longhorn-share-manager:v1_20201204
longhornio/longhorn-ui:v1.0.2 longhornio/longhorn-manager:master
longhornio/csi-attacher:v2.0.0 longhornio/longhorn-ui:master
longhornio/csi-node-driver-registrar:v1.2.0 longhornio/csi-attacher:v2.2.1-lh1
longhornio/csi-provisioner:v1.4.0 longhornio/csi-provisioner:v1.6.0-lh1
longhornio/csi-resizer:v0.3.0 longhornio/csi-resizer:v0.5.1-lh1
longhornio/csi-snapshotter:v2.1.1-lh1
longhornio/csi-node-driver-registrar:v1.2.0-lh1

View File

@ -32,22 +32,29 @@ rules:
- apiGroups: ["batch"] - apiGroups: ["batch"]
resources: ["jobs", "cronjobs"] resources: ["jobs", "cronjobs"]
verbs: ["*"] verbs: ["*"]
- apiGroups: ["policy"]
resources: ["poddisruptionbudgets"]
verbs: ["*"]
- apiGroups: ["scheduling.k8s.io"] - apiGroups: ["scheduling.k8s.io"]
resources: ["priorityclasses"] resources: ["priorityclasses"]
verbs: ["watch", "list"] verbs: ["watch", "list"]
- apiGroups: ["storage.k8s.io"] - apiGroups: ["storage.k8s.io"]
resources: ["storageclasses", "volumeattachments", "csinodes", "csidrivers"] resources: ["storageclasses", "volumeattachments", "csinodes", "csidrivers"]
verbs: ["*"] verbs: ["*"]
- apiGroups: ["coordination.k8s.io"] - apiGroups: ["snapshot.storage.k8s.io"]
resources: ["leases"] resources: ["volumesnapshotclasses", "volumesnapshots", "volumesnapshotcontents", "volumesnapshotcontents/status"]
verbs: ["get", "watch", "list", "delete", "update", "create"] verbs: ["*"]
- apiGroups: ["longhorn.io"] - apiGroups: ["longhorn.io"]
resources: ["volumes", "volumes/status", "engines", "engines/status", "replicas", "replicas/status", "settings", resources: ["volumes", "volumes/status", "engines", "engines/status", "replicas", "replicas/status", "settings",
"engineimages", "engineimages/status", "nodes", "nodes/status", "instancemanagers", "instancemanagers/status"] "engineimages", "engineimages/status", "nodes", "nodes/status", "instancemanagers", "instancemanagers/status",
"sharemanagers", "sharemanagers/status"]
verbs: ["*"] verbs: ["*"]
- apiGroups: ["coordination.k8s.io"] - apiGroups: ["coordination.k8s.io"]
resources: ["leases"] resources: ["leases"]
verbs: ["*"] verbs: ["*"]
- apiGroups: ["metrics.k8s.io"]
resources: ["pods", "nodes"]
verbs: ["get", "list"]
--- ---
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding kind: ClusterRoleBinding
@ -62,7 +69,7 @@ subjects:
name: longhorn-service-account name: longhorn-service-account
namespace: longhorn-system namespace: longhorn-system
--- ---
apiVersion: apiextensions.k8s.io/v1beta1 apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition kind: CustomResourceDefinition
metadata: metadata:
labels: labels:
@ -78,11 +85,42 @@ spec:
- lhe - lhe
singular: engine singular: engine
scope: Namespaced scope: Namespaced
version: v1beta1 versions:
- name: v1beta1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
x-kubernetes-preserve-unknown-fields: true
status:
x-kubernetes-preserve-unknown-fields: true
subresources: subresources:
status: {} status: {}
additionalPrinterColumns:
- name: State
type: string
description: The current state of the engine
jsonPath: .status.currentState
- name: Node
type: string
description: The node that the engine is on
jsonPath: .spec.nodeID
- name: InstanceManager
type: string
description: The instance manager of the engine
jsonPath: .status.instanceManagerName
- name: Image
type: string
description: The current image of the engine
jsonPath: .status.currentImage
- name: Age
type: date
jsonPath: .metadata.creationTimestamp
--- ---
apiVersion: apiextensions.k8s.io/v1beta1 apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition kind: CustomResourceDefinition
metadata: metadata:
labels: labels:
@ -98,11 +136,46 @@ spec:
- lhr - lhr
singular: replica singular: replica
scope: Namespaced scope: Namespaced
version: v1beta1 versions:
- name: v1beta1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
x-kubernetes-preserve-unknown-fields: true
status:
x-kubernetes-preserve-unknown-fields: true
subresources: subresources:
status: {} status: {}
additionalPrinterColumns:
- name: State
type: string
description: The current state of the replica
jsonPath: .status.currentState
- name: Node
type: string
description: The node that the replica is on
jsonPath: .spec.nodeID
- name: Disk
type: string
description: The disk that the replica is on
jsonPath: .spec.diskID
- name: InstanceManager
type: string
description: The instance manager of the replica
jsonPath: .status.instanceManagerName
- name: Image
type: string
description: The current image of the replica
jsonPath: .status.currentImage
- name: Age
type: date
jsonPath: .metadata.creationTimestamp
--- ---
apiVersion: apiextensions.k8s.io/v1beta1 apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition kind: CustomResourceDefinition
metadata: metadata:
labels: labels:
@ -118,9 +191,23 @@ spec:
- lhs - lhs
singular: setting singular: setting
scope: Namespaced scope: Namespaced
version: v1beta1 versions:
- name: v1beta1
served: true
storage: true
schema:
openAPIV3Schema:
x-kubernetes-preserve-unknown-fields: true
additionalPrinterColumns:
- name: Value
type: string
description: The value of the setting
jsonPath: .value
- name: Age
type: date
jsonPath: .metadata.creationTimestamp
--- ---
apiVersion: apiextensions.k8s.io/v1beta1 apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition kind: CustomResourceDefinition
metadata: metadata:
labels: labels:
@ -136,11 +223,46 @@ spec:
- lhv - lhv
singular: volume singular: volume
scope: Namespaced scope: Namespaced
version: v1beta1 versions:
- name: v1beta1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
x-kubernetes-preserve-unknown-fields: true
status:
x-kubernetes-preserve-unknown-fields: true
subresources: subresources:
status: {} status: {}
additionalPrinterColumns:
- name: State
type: string
description: The state of the volume
jsonPath: .status.state
- name: Robustness
type: string
description: The robustness of the volume
jsonPath: .status.robustness
- name: Scheduled
type: string
description: The scheduled condition of the volume
jsonPath: .status.conditions['scheduled']['status']
- name: Size
type: string
description: The size of the volume
jsonPath: .spec.size
- name: Node
type: string
description: The node that the volume is currently attaching to
jsonPath: .status.currentNodeID
- name: Age
type: date
jsonPath: .metadata.creationTimestamp
--- ---
apiVersion: apiextensions.k8s.io/v1beta1 apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition kind: CustomResourceDefinition
metadata: metadata:
labels: labels:
@ -156,11 +278,42 @@ spec:
- lhei - lhei
singular: engineimage singular: engineimage
scope: Namespaced scope: Namespaced
version: v1beta1 versions:
- name: v1beta1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
x-kubernetes-preserve-unknown-fields: true
status:
x-kubernetes-preserve-unknown-fields: true
subresources: subresources:
status: {} status: {}
additionalPrinterColumns:
- name: State
type: string
description: State of the engine image
jsonPath: .status.state
- name: Image
type: string
description: The Longhorn engine image
jsonPath: .spec.image
- name: RefCount
type: integer
description: Number of volumes are using the engine image
jsonPath: .status.refCount
- name: BuildDate
type: date
description: The build date of the engine image
jsonPath: .status.buildDate
- name: Age
type: date
jsonPath: .metadata.creationTimestamp
--- ---
apiVersion: apiextensions.k8s.io/v1beta1 apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition kind: CustomResourceDefinition
metadata: metadata:
labels: labels:
@ -176,11 +329,38 @@ spec:
- lhn - lhn
singular: node singular: node
scope: Namespaced scope: Namespaced
version: v1beta1 versions:
- name: v1beta1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
x-kubernetes-preserve-unknown-fields: true
status:
x-kubernetes-preserve-unknown-fields: true
subresources: subresources:
status: {} status: {}
additionalPrinterColumns:
- name: Ready
type: string
description: Indicate whether the node is ready
jsonPath: .status.conditions['Ready']['status']
- name: AllowScheduling
type: boolean
description: Indicate whether the user disabled/enabled replica scheduling for the node
jsonPath: .spec.allowScheduling
- name: Schedulable
type: string
description: Indicate whether Longhorn can schedule replicas on the node
jsonPath: .status.conditions['Schedulable']['status']
- name: Age
type: date
jsonPath: .metadata.creationTimestamp
--- ---
apiVersion: apiextensions.k8s.io/v1beta1 apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition kind: CustomResourceDefinition
metadata: metadata:
labels: labels:
@ -196,9 +376,79 @@ spec:
- lhim - lhim
singular: instancemanager singular: instancemanager
scope: Namespaced scope: Namespaced
version: v1beta1 versions:
- name: v1beta1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
x-kubernetes-preserve-unknown-fields: true
status:
x-kubernetes-preserve-unknown-fields: true
subresources: subresources:
status: {} status: {}
additionalPrinterColumns:
- name: State
type: string
description: The state of the instance manager
jsonPath: .status.currentState
- name: Type
type: string
description: The type of the instance manager (engine or replica)
jsonPath: .spec.type
- name: Node
type: string
description: The node that the instance manager is running on
jsonPath: .spec.nodeID
- name: Age
type: date
jsonPath: .metadata.creationTimestamp
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
labels:
longhorn-manager: ShareManager
name: sharemanagers.longhorn.io
spec:
group: longhorn.io
names:
kind: ShareManager
listKind: ShareManagerList
plural: sharemanagers
shortNames:
- lhsm
singular: sharemanager
scope: Namespaced
versions:
- name: v1beta1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
x-kubernetes-preserve-unknown-fields: true
status:
x-kubernetes-preserve-unknown-fields: true
subresources:
status: {}
additionalPrinterColumns:
- name: State
type: string
description: The state of the share manager
jsonPath: .status.state
- name: Node
type: string
description: The node that the share manager is owned by
jsonPath: .status.ownerID
- name: Age
type: date
jsonPath: .metadata.creationTimestamp
--- ---
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
@ -209,6 +459,7 @@ data:
default-setting.yaml: |- default-setting.yaml: |-
backup-target: backup-target:
backup-target-credential-secret: backup-target-credential-secret:
allow-recurring-job-while-volume-detached:
create-default-disk-labeled-nodes: create-default-disk-labeled-nodes:
default-data-path: default-data-path:
replica-soft-anti-affinity: replica-soft-anti-affinity:
@ -216,17 +467,26 @@ data:
storage-minimal-available-percentage: storage-minimal-available-percentage:
upgrade-checker: upgrade-checker:
default-replica-count: default-replica-count:
default-data-locality:
guaranteed-engine-cpu: guaranteed-engine-cpu:
default-longhorn-static-storage-class: default-longhorn-static-storage-class:
backupstore-poll-interval: backupstore-poll-interval:
taint-toleration: taint-toleration:
priority-class: priority-class:
registry-secret:
auto-salvage: auto-salvage:
auto-delete-pod-when-volume-detached-unexpectedly:
disable-scheduling-on-cordoned-node: disable-scheduling-on-cordoned-node:
replica-zone-soft-anti-affinity: replica-zone-soft-anti-affinity:
volume-attachment-recovery-policy: volume-attachment-recovery-policy:
node-down-pod-deletion-policy:
allow-node-drain-with-last-healthy-replica:
mkfs-ext4-parameters: mkfs-ext4-parameters:
disable-replica-rebuild:
replica-replenishment-wait-interval:
disable-revision-counter:
system-managed-pods-image-pull-policy:
allow-volume-creation-with-degraded-availability:
auto-cleanup-system-generated-snapshot:
--- ---
apiVersion: policy/v1beta1 apiVersion: policy/v1beta1
kind: PodSecurityPolicy kind: PodSecurityPolicy
@ -290,6 +550,31 @@ subjects:
name: default name: default
namespace: longhorn-system namespace: longhorn-system
--- ---
apiVersion: v1
kind: ConfigMap
metadata:
name: longhorn-storageclass
namespace: longhorn-system
data:
storageclass.yaml: |
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: longhorn
provisioner: driver.longhorn.io
allowVolumeExpansion: true
reclaimPolicy: Delete
volumeBindingMode: Immediate
parameters:
numberOfReplicas: "3"
staleReplicaTimeout: "2880"
fromBackup: ""
# diskSelector: "ssd,fast"
# nodeSelector: "storage,fast"
# recurringJobs: '[{"name":"snap", "task":"snapshot", "cron":"*/1 * * * *", "retain":1},
# {"name":"backup", "task":"backup", "cron":"*/2 * * * *", "retain":1,
# "labels": {"interval":"2m"}}]'
---
apiVersion: apps/v1 apiVersion: apps/v1
kind: DaemonSet kind: DaemonSet
metadata: metadata:
@ -308,7 +593,7 @@ spec:
spec: spec:
containers: containers:
- name: longhorn-manager - name: longhorn-manager
image: longhornio/longhorn-manager:v1.0.2 image: longhornio/longhorn-manager:master
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
securityContext: securityContext:
privileged: true privileged: true
@ -317,11 +602,13 @@ spec:
- -d - -d
- daemon - daemon
- --engine-image - --engine-image
- longhornio/longhorn-engine:v1.0.2 - longhornio/longhorn-engine:master
- --instance-manager-image - --instance-manager-image
- longhornio/longhorn-instance-manager:v1_20200514 - longhornio/longhorn-instance-manager:v1_20201021
- --share-manager-image
- longhornio/longhorn-share-manager:v1_20201204
- --manager-image - --manager-image
- longhornio/longhorn-manager:v1.0.2 - longhornio/longhorn-manager:master
- --service-account - --service-account
- longhorn-service-account - longhorn-service-account
ports: ports:
@ -418,7 +705,7 @@ spec:
spec: spec:
containers: containers:
- name: longhorn-ui - name: longhorn-ui
image: longhornio/longhorn-ui:v1.0.2 image: longhornio/longhorn-ui:master
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
securityContext: securityContext:
runAsUser: 0 runAsUser: 0
@ -465,18 +752,18 @@ spec:
spec: spec:
initContainers: initContainers:
- name: wait-longhorn-manager - name: wait-longhorn-manager
image: longhornio/longhorn-manager:v1.0.2 image: longhornio/longhorn-manager:master
command: ['sh', '-c', 'while [ $(curl -m 1 -s -o /dev/null -w "%{http_code}" http://longhorn-backend:9500/v1) != "200" ]; do echo waiting; sleep 2; done'] command: ['sh', '-c', 'while [ $(curl -m 1 -s -o /dev/null -w "%{http_code}" http://longhorn-backend:9500/v1) != "200" ]; do echo waiting; sleep 2; done']
containers: containers:
- name: longhorn-driver-deployer - name: longhorn-driver-deployer
image: longhornio/longhorn-manager:v1.0.2 image: longhornio/longhorn-manager:master
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
command: command:
- longhorn-manager - longhorn-manager
- -d - -d
- deploy-driver - deploy-driver
- --manager-image - --manager-image
- longhornio/longhorn-manager:v1.0.2 - longhornio/longhorn-manager:master
- --manager-url - --manager-url
- http://longhorn-backend:9500/v1 - http://longhorn-backend:9500/v1
env: env:
@ -498,13 +785,15 @@ spec:
# For AirGap Installation # For AirGap Installation
# Replace PREFIX with your private registery # Replace PREFIX with your private registery
#- name: CSI_ATTACHER_IMAGE #- name: CSI_ATTACHER_IMAGE
# value: PREFIX/csi-attacher:v2.0.0 # value: PREFIX/csi-attacher:v2.2.1-lh1
#- name: CSI_PROVISIONER_IMAGE #- name: CSI_PROVISIONER_IMAGE
# value: PREFIX/csi-provisioner:v1.4.0 # value: PREFIX/csi-provisioner:v1.6.0-lh1
#- name: CSI_NODE_DRIVER_REGISTRAR_IMAGE #- name: CSI_NODE_DRIVER_REGISTRAR_IMAGE
# value: PREFIX/csi-node-driver-registrar:v1.2.0 # value: PREFIX/csi-node-driver-registrar:v1.2.0-lh1
#- name: CSI_RESIZER_IMAGE #- name: CSI_RESIZER_IMAGE
# value: PREFIX/csi-resizer:v0.3.0 # value: PREFIX/csi-resizer:v0.5.1-lh1
#- name: CSI_SNAPSHOTTER_IMAGE
# value: PREFIX/csi-snapshotter:v2.1.1-lh1
# Manually specify number of CSI attacher replicas # Manually specify number of CSI attacher replicas
#- name: CSI_ATTACHER_REPLICA_COUNT #- name: CSI_ATTACHER_REPLICA_COUNT
# value: "3" # value: "3"
@ -513,25 +802,11 @@ spec:
# value: "3" # value: "3"
#- name: CSI_RESIZER_REPLICA_COUNT #- name: CSI_RESIZER_REPLICA_COUNT
# value: "3" # value: "3"
#- name: CSI_SNAPSHOTTER_REPLICA_COUNT
# value: "3"
#imagePullSecrets: #imagePullSecrets:
#- name: #- name:
serviceAccountName: longhorn-service-account serviceAccountName: longhorn-service-account
securityContext: securityContext:
runAsUser: 0 runAsUser: 0
--- ---
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: longhorn
provisioner: driver.longhorn.io
allowVolumeExpansion: true
parameters:
numberOfReplicas: "3"
staleReplicaTimeout: "2880"
fromBackup: ""
# diskSelector: "ssd,fast"
# nodeSelector: "storage,fast"
# recurringJobs: '[{"name":"snap", "task":"snapshot", "cron":"*/1 * * * *", "retain":1},
# {"name":"backup", "task":"backup", "cron":"*/2 * * * *", "retain":1,
# "labels": {"interval":"2m"}}]'
---

View File

@ -1,8 +1,10 @@
longhornio/longhorn-engine:v1.0.2 longhornio/longhorn-engine:master
longhornio/longhorn-instance-manager:v1_20200514 longhornio/longhorn-instance-manager:v1_20201021
longhornio/longhorn-manager:v1.0.2 longhornio/longhorn-share-manager:v1_20201204
longhornio/longhorn-ui:v1.0.2 longhornio/longhorn-manager:master
quay.io/k8scsi/csi-attacher:v2.0.0 longhornio/longhorn-ui:master
quay.io/k8scsi/csi-node-driver-registrar:v1.2.0 longhornio/csi-attacher:v2.2.1-lh1
quay.io/k8scsi/csi-provisioner:v1.4.0 longhornio/csi-provisioner:v1.6.0-lh1
quay.io/k8scsi/csi-resizer:v0.3.0 longhornio/csi-resizer:v0.5.1-lh1
longhornio/csi-snapshotter:v2.1.1-lh1
longhornio/csi-node-driver-registrar:v1.2.0-lh1

View File

@ -2,6 +2,7 @@ apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
metadata: metadata:
name: longhorn-block-vol name: longhorn-block-vol
namespace: default
spec: spec:
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce

View File

@ -22,6 +22,7 @@ apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
metadata: metadata:
name: longhorn-vol-pvc name: longhorn-vol-pvc
namespace: default
spec: spec:
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce

View File

@ -15,6 +15,7 @@ apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
metadata: metadata:
name: mysql-pvc name: mysql-pvc
namespace: default
spec: spec:
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
@ -29,6 +30,7 @@ metadata:
name: mysql name: mysql
labels: labels:
app: mysql app: mysql
namespace: default
spec: spec:
selector: selector:
matchLabels: matchLabels:
@ -51,9 +53,6 @@ spec:
- /var/lib/mysql/lost+found - /var/lib/mysql/lost+found
initialDelaySeconds: 5 initialDelaySeconds: 5
periodSeconds: 5 periodSeconds: 5
env:
- name: MYSQL_ROOT_PASSWORD
value: changeme
ports: ports:
- containerPort: 3306 - containerPort: 3306
name: mysql name: mysql

View File

@ -2,6 +2,7 @@ apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
metadata: metadata:
name: longhorn-volv-pvc name: longhorn-volv-pvc
namespace: default
spec: spec:
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce

View File

@ -44,7 +44,7 @@ rules:
verbs: ["get"] verbs: ["get"]
- apiGroups: ["extensions"] - apiGroups: ["extensions"]
resources: ["podsecuritypolicies"] resources: ["podsecuritypolicies"]
resourceNames: ["nfs-provisioner"] resourceNames: ["longhorn-nfs-provisioner"]
verbs: ["use"] verbs: ["use"]
--- ---
kind: ClusterRoleBinding kind: ClusterRoleBinding

View File

@ -2,6 +2,7 @@ apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
metadata: metadata:
name: nfs-test name: nfs-test
namespace: default
spec: spec:
accessModes: accessModes:
- ReadWriteMany - ReadWriteMany
@ -16,6 +17,7 @@ metadata:
name: nfs-test name: nfs-test
labels: labels:
app: nfs-test app: nfs-test
namespace: default
spec: spec:
replicas: 4 replicas: 4
selector: selector:

View File

@ -2,6 +2,7 @@ apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
metadata: metadata:
name: longhorn-simple-pvc name: longhorn-simple-pvc
namespace: default
spec: spec:
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce

View File

@ -0,0 +1,14 @@
apiVersion: snapshot.storage.k8s.io/v1beta1
kind: VolumeSnapshotContent
metadata:
name: test-existing-backup
spec:
volumeSnapshotClassName: longhorn
driver: driver.longhorn.io
deletionPolicy: Delete
source:
# NOTE: change this to point to an existing backup on the backupstore
snapshotHandle: bs://test-vol/backup-625159fb469e492e
volumeSnapshotRef:
name: test-snapshot-existing-backup
namespace: default

View File

@ -0,0 +1,16 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: test-restore-existing-backup
namespace: default
spec:
storageClassName: longhorn
dataSource:
name: test-snapshot-existing-backup
kind: VolumeSnapshot
apiGroup: snapshot.storage.k8s.io
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi

View File

@ -0,0 +1,16 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: test-restore-snapshot-pvc
namespace: default
spec:
storageClassName: longhorn
dataSource:
name: test-snapshot-pvc
kind: VolumeSnapshot
apiGroup: snapshot.storage.k8s.io
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi

View File

@ -0,0 +1,8 @@
apiVersion: snapshot.storage.k8s.io/v1beta1
kind: VolumeSnapshot
metadata:
name: test-snapshot-existing-backup
spec:
volumeSnapshotClassName: longhorn
source:
volumeSnapshotContentName: test-existing-backup

View File

@ -0,0 +1,8 @@
apiVersion: snapshot.storage.k8s.io/v1beta1
kind: VolumeSnapshot
metadata:
name: test-snapshot-pvc
spec:
volumeSnapshotClassName: longhorn
source:
persistentVolumeClaimName: test-vol

View File

@ -0,0 +1,9 @@
kind: VolumeSnapshotClass
apiVersion: snapshot.storage.k8s.io/v1beta1
metadata:
name: longhorn
driver: driver.longhorn.io
deletionPolicy: Delete
#parameters:
# csi.storage.k8s.io/snapshotter-secret-name: mysecret
# csi.storage.k8s.io/snapshotter-secret-namespace: mysecretnamespace

View File

@ -16,6 +16,7 @@ apiVersion: apps/v1
kind: StatefulSet kind: StatefulSet
metadata: metadata:
name: web name: web
namespace: default
spec: spec:
selector: selector:
matchLabels: matchLabels:

View File

@ -16,7 +16,7 @@ rules:
verbs: verbs:
- "*" - "*"
- apiGroups: [""] - apiGroups: [""]
resources: ["pods", "persistentvolumes", "persistentvolumeclaims", "nodes"] resources: ["pods", "persistentvolumes", "persistentvolumeclaims", "nodes", "configmaps"]
verbs: ["*"] verbs: ["*"]
- apiGroups: ["apps"] - apiGroups: ["apps"]
resources: ["daemonsets", "statefulsets", "deployments"] resources: ["daemonsets", "statefulsets", "deployments"]
@ -24,15 +24,21 @@ rules:
- apiGroups: ["batch"] - apiGroups: ["batch"]
resources: ["jobs", "cronjobs"] resources: ["jobs", "cronjobs"]
verbs: ["*"] verbs: ["*"]
- apiGroups: ["policy"]
resources: ["poddisruptionbudgets"]
verbs: ["*"]
- apiGroups: ["scheduling.k8s.io"] - apiGroups: ["scheduling.k8s.io"]
resources: ["priorityclasses"] resources: ["priorityclasses"]
verbs: ["watch", "list"] verbs: ["watch", "list"]
- apiGroups: ["storage.k8s.io"] - apiGroups: ["storage.k8s.io"]
resources: ["csidrivers"] resources: ["csidrivers", "storageclasses"]
verbs: ["*"] verbs: ["*"]
- apiGroups: ["longhorn.io"] - apiGroups: ["longhorn.io"]
resources: ["volumes", "engines", "replicas", "settings", "engineimages", "nodes", "instancemanagers"] resources: ["volumes", "engines", "replicas", "settings", "engineimages", "nodes", "instancemanagers"]
verbs: ["*"] verbs: ["*"]
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["*"]
--- ---
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding kind: ClusterRoleBinding
@ -61,7 +67,7 @@ spec:
spec: spec:
containers: containers:
- name: longhorn-uninstall - name: longhorn-uninstall
image: longhornio/longhorn-manager:v1.0.2 image: longhornio/longhorn-manager:master
imagePullPolicy: Always imagePullPolicy: Always
command: command:
- longhorn-manager - longhorn-manager