diff --git a/deploy/longhorn.yaml b/deploy/longhorn.yaml index 62c4884..83f6744 100644 --- a/deploy/longhorn.yaml +++ b/deploy/longhorn.yaml @@ -181,7 +181,7 @@ spec: spec: containers: - name: longhorn-manager - image: rancher/longhorn-manager:v0.4.1 + image: rancher/longhorn-manager:v0.5.0-rc1 imagePullPolicy: Always securityContext: privileged: true @@ -190,9 +190,9 @@ spec: - -d - daemon - --engine-image - - rancher/longhorn-engine:v0.4.1 + - rancher/longhorn-engine:v0.5.0-rc1 - --manager-image - - rancher/longhorn-manager:v0.4.1 + - rancher/longhorn-manager:v0.5.0-rc1 - --service-account - longhorn-service-account ports: @@ -269,7 +269,7 @@ spec: spec: containers: - name: longhorn-ui - image: rancher/longhorn-ui:v0.4.1 + image: rancher/longhorn-ui:v0.5.0-rc1 ports: - containerPort: 8000 env: @@ -308,26 +308,35 @@ spec: spec: initContainers: - name: wait-longhorn-manager - image: rancher/longhorn-manager:v0.4.1 + image: rancher/longhorn-manager:v0.5.0-rc1 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: - name: longhorn-driver-deployer - image: rancher/longhorn-manager:v0.4.1 + image: rancher/longhorn-manager:v0.5.0-rc1 imagePullPolicy: Always command: - longhorn-manager - -d - deploy-driver - --manager-image - - rancher/longhorn-manager:v0.4.1 + - rancher/longhorn-manager:v0.5.0-rc1 - --manager-url - http://longhorn-backend:9500/v1 # manually choose "flexvolume" or "csi" #- --driver #- flexvolume + # manually set root directory for flexvolume + #- --flexvolume-dir + #- /usr/libexec/kubernetes/kubelet-plugins/volume/exec/ # manually set root directory for csi #- --kubelet-root-dir #- /var/lib/rancher/k3s/agent/kubelet + # manually specify number of CSI attacher replicas + #- --csi-attacher-replica-count + #- "3" + # manually specify number of CSI provisioner replicas + #- --csi-provisioner-replica-count + #- "3" env: - name: POD_NAMESPACE valueFrom: diff --git a/examples/storageclass.yaml b/examples/storageclass.yaml index a7e813d..3d5e5bb 100644 --- a/examples/storageclass.yaml +++ b/examples/storageclass.yaml @@ -7,3 +7,5 @@ parameters: numberOfReplicas: "3" staleReplicaTimeout: "30" fromBackup: "" +# recurringJobs: '[{"name":"snap", "task":"snapshot", "cron":"*/1 * * * *", "retain":1}, +# {"name":"backup", "task":"backup", "cron":"*/2 * * * *", "retain":1}]' \ No newline at end of file diff --git a/uninstall/uninstall.yaml b/uninstall/uninstall.yaml index 64c9209..ca12a17 100644 --- a/uninstall/uninstall.yaml +++ b/uninstall/uninstall.yaml @@ -1,8 +1,49 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: longhorn-uninstall-service-account +--- +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRole +metadata: + name: longhorn-uninstall-role +rules: + - apiGroups: + - apiextensions.k8s.io + resources: + - customresourcedefinitions + verbs: + - "*" + - apiGroups: [""] + resources: ["pods", "persistentvolumes", "persistentvolumeclaims"] + verbs: ["*"] + - apiGroups: ["apps"] + resources: ["daemonsets", "statefulsets", "deployments"] + verbs: ["*"] + - apiGroups: ["batch"] + resources: ["jobs", "cronjobs"] + verbs: ["*"] + - apiGroups: ["longhorn.rancher.io"] + resources: ["volumes", "engines", "replicas", "settings", "engineimages", "nodes"] + verbs: ["*"] +--- +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRoleBinding +metadata: + name: longhorn-uninstall-bind +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: longhorn-uninstall-role +subjects: + - kind: ServiceAccount + name: longhorn-uninstall-service-account + namespace: default +--- apiVersion: batch/v1 kind: Job metadata: name: longhorn-uninstall - namespace: longhorn-system spec: activeDeadlineSeconds: 900 backoffLimit: 1 @@ -12,16 +53,14 @@ spec: spec: containers: - name: longhorn-uninstall - image: rancher/longhorn-manager:v0.4.1 + image: rancher/longhorn-manager:v0.5.0-rc1 imagePullPolicy: Always command: - longhorn-manager - uninstall - --force env: - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace + - name: LONGHORN_NAMESPACE + value: longhorn-system restartPolicy: OnFailure - serviceAccountName: longhorn-service-account + serviceAccountName: longhorn-uninstall-service-account