chart: Remove flexvolume

Longhorn #358

Signed-off-by: Shuo Wu <shuo@rancher.com>
This commit is contained in:
Shuo Wu 2019-11-11 17:34:48 -08:00 committed by Sheng Yang
parent 62cc78c922
commit 24fa15dc05
4 changed files with 51 additions and 85 deletions

View File

@ -8,15 +8,15 @@ The following document pertains to running Longhorn from the Rancher 2.0 chart.
Longhorn is 100% open source software. Project source code is spread across a number of repos: Longhorn is 100% open source software. Project source code is spread across a number of repos:
1. Longhorn Engine -- Core controller/replica logic https://github.com/rancher/longhorn-engine 1. Longhorn Engine -- Core controller/replica logic https://github.com/longhorn/longhorn-engine
2. Longhorn Manager -- Longhorn orchestration, includes Flexvolume driver for Kubernetes https://github.com/rancher/longhorn-manager 2. Longhorn Manager -- Longhorn orchestration, includes CSI driver for Kubernetes https://github.com/longhorn/longhorn-manager
3. Longhorn UI -- Dashboard https://github.com/rancher/longhorn-ui 3. Longhorn UI -- Dashboard https://github.com/longhorn/longhorn-ui
## Prerequisites ## Prerequisites
1. Rancher v2.1+ 1. Rancher v2.1+
2. Docker v1.13+ 2. Docker v1.13+
3. Kubernetes v1.8+ cluster with 1 or more nodes and Mount Propagation feature enabled. If your Kubernetes cluster was provisioned by Rancher v2.0.7+ or later, MountPropagation feature is enabled by default. [Check your Kubernetes environment now](https://github.com/rancher/longhorn#environment-check-script). If MountPropagation is disabled, the Kubernetes Flexvolume driver will be deployed instead of the default CSI driver. Base Image feature will also be disabled if MountPropagation is disabled. 3. Kubernetes v1.14+
4. Make sure `curl`, `findmnt`, `grep`, `awk` and `blkid` has been installed in all nodes of the Kubernetes cluster. 4. Make sure `curl`, `findmnt`, `grep`, `awk` and `blkid` has been installed in all nodes of the Kubernetes cluster.
5. Make sure `open-iscsi` has been installed in all nodes of the Kubernetes cluster. For GKE, recommended Ubuntu as guest OS image since it contains `open-iscsi` already. 5. Make sure `open-iscsi` has been installed in all nodes of the Kubernetes cluster. For GKE, recommended Ubuntu as guest OS image since it contains `open-iscsi` already.
@ -37,23 +37,10 @@ Redeploy the (same version) Longhorn App. Follow the uninstallation procedure ab
If your CRD instances or the CRDs themselves can't be deleted for whatever reason, run the commands below to clean up. Caution: this will wipe all Longhorn state! If your CRD instances or the CRDs themselves can't be deleted for whatever reason, run the commands below to clean up. Caution: this will wipe all Longhorn state!
``` ```
# Delete CRD finalizers, instances and definitions # Delete CRD instances and definitions
for crd in $(kubectl get crd -o jsonpath={.items[*].metadata.name} | tr ' ' '\n' | grep longhorn.rancher.io); do curl -s https://raw.githubusercontent.com/longhorn/longhorn-manager/master/hack/cleancrs.sh |bash -s v062
kubectl -n ${NAMESPACE} get $crd -o yaml | sed "s/\- longhorn.rancher.io//g" | kubectl apply -f - curl -s https://raw.githubusercontent.com/longhorn/longhorn-manager/master/hack/cleancrs.sh |bash -s v070
kubectl -n ${NAMESPACE} delete $crd --all
kubectl delete crd/$crd
done
``` ```
### Volume can be attached/detached from UI, but Kubernetes Pod/StatefulSet etc cannot use it
Check if volume plugin directory has been set correctly. This is automatically detected unless user explicitly set it.
By default, Kubernetes uses `/usr/libexec/kubernetes/kubelet-plugins/volume/exec/`, as stated in the [official document](https://github.com/kubernetes/community/blob/master/contributors/devel/flexvolume.md#prerequisites).
Some vendors choose to change the directory for various reasons. For example, GKE uses `/home/kubernetes/flexvolume` instead.
User can find the correct directory by running `ps aux|grep kubelet` on the host and check the `--volume-plugin-dir` parameter. If there is none, the default `/usr/libexec/kubernetes/kubelet-plugins/volume/exec/` will be used.
--- ---
Please see [link](https://github.com/rancher/longhorn) for more information. Please see [link](https://github.com/longhorn/longhorn) for more information.

View File

@ -4,73 +4,62 @@ labels:
io.rancher.certified: experimental io.rancher.certified: experimental
namespace: longhorn-system namespace: longhorn-system
questions: questions:
- variable: driver
default: csi
description: "Deploy either the CSI or FlexVolume driver. CSI is newer but requires MountPropagation, a feature enabled by default in Kubernetes v1.10 and later"
type: enum
options:
- csi
- flexvolume
label: Longhorn Kubernetes Driver
group: "Longhorn Driver Settings"
show_subquestion_if: flexvolume
subquestions:
- variable: persistence.flexvolumePath
default: ""
description: "Leave blank to autodetect. For RKE, use `/var/lib/kubelet/volumeplugins`. For GKE, use `/home/kubernetes/flexvolume/` instead. Users can find the correct directory by running `ps aux|grep kubelet` on the host and check the --volume-plugin-dir parameter. If there is none, the default `/usr/libexec/kubernetes/kubelet-plugins/volume/exec/` will be used."
type: string
label: Longhorn Flexvolume Path
show_subquestion_if: csi
subquestions:
- variable: csi.attacherImage - variable: csi.attacherImage
default: default:
description: "Specify CSI attacher image. Leave blank to autodetect." description: "Specify CSI attacher image. Leave blank to autodetect."
type: string type: string
label: Longhorn CSI Attacher Image label: Longhorn CSI Attacher Image
group: "Longhorn CSI Driver Settings"
- variable: csi.provisionerImage - variable: csi.provisionerImage
default: default:
description: "Specify CSI provisioner image. Leave blank to autodetect." description: "Specify CSI provisioner image. Leave blank to autodetect."
type: string type: string
label: Longhorn CSI Provisioner Image label: Longhorn CSI Provisioner Image
group: "Longhorn CSI Driver Settings"
- variable: csi.driverRegistrarImage - variable: csi.driverRegistrarImage
default: default:
description: "Specify CSI Driver Registrar image. Leave blank to autodetect." description: "Specify CSI Driver Registrar image. Leave blank to autodetect."
type: string type: string
label: Longhorn CSI Driver Registrar Image label: Longhorn CSI Driver Registrar Image
group: "Longhorn CSI Driver Settings"
- variable: csi.kubeletRootDir - variable: csi.kubeletRootDir
default: default:
description: "Specify kubelet root-dir. Leave blank to autodetect." description: "Specify kubelet root-dir. Leave blank to autodetect."
type: string type: string
label: Kubelet Root Directory label: Kubelet Root Directory
group: "Longhorn CSI Driver Settings"
- variable: csi.attacherReplicaCount - variable: csi.attacherReplicaCount
type: int type: int
default: default:
min: 1 min: 1
max: 10 max: 10
description: "Specify number of CSI Attacher replica. By default 3." description: "Specify replica count of CSI Attacher. By default 3."
label: Longhorn CSI Attacher replica count label: Longhorn CSI Attacher replica count
group: "Longhorn CSI Driver Settings"
- variable: csi.provisionerReplicaCount - variable: csi.provisionerReplicaCount
type: int type: int
default: default:
min: 1 min: 1
max: 10 max: 10
description: "Specify number of CSI Provisioner replica. By default 3." description: "Specify replica count of CSI Provisioner. By default 3."
label: Longhorn CSI Provisioner replica count label: Longhorn CSI Provisioner replica count
group: "Longhorn CSI Driver Settings"
- variable: persistence.defaultClass - variable: persistence.defaultClass
default: "true" default: "true"
description: "Set as default StorageClass" description: "Set as default StorageClass"
group: "Longhorn Driver Settings" group: "Longhorn CSI Driver Settings"
type: boolean type: boolean
required: true required: true
label: Default Storage Class label: Default Storage Class
- variable: persistence.defaultClassReplicaCount - variable: persistence.defaultClassReplicaCount
description: "Set replica count for default StorageClass" description: "Set replica count for default StorageClass"
group: "Longhorn Driver Settings" group: "Longhorn CSI Driver Settings"
type: int type: int
default: 3 default: 3
min: 1 min: 1
max: 10 max: 10
label: Default Storage Class Replica Count label: Default Storage Class Replica Count
- variable: defaultSettings.backupTarget - variable: defaultSettings.backupTarget
label: Backup Target label: Backup Target
description: "The target used for backup. Support NFS or S3." description: "The target used for backup. Support NFS or S3."

View File

@ -29,8 +29,6 @@ spec:
- "{{ .Values.image.longhorn.manager }}:{{ .Values.image.longhorn.managerTag }}" - "{{ .Values.image.longhorn.manager }}:{{ .Values.image.longhorn.managerTag }}"
- --manager-url - --manager-url
- http://longhorn-backend:9500/v1 - http://longhorn-backend:9500/v1
- --driver
- "{{ .Values.driver }}"
env: env:
- name: POD_NAMESPACE - name: POD_NAMESPACE
valueFrom: valueFrom:
@ -44,8 +42,6 @@ spec:
valueFrom: valueFrom:
fieldRef: fieldRef:
fieldPath: spec.serviceAccountName fieldPath: spec.serviceAccountName
- name: FLEXVOLUME_DIR
value: {{ .Values.persistence.flexvolumePath }}
{{- if .Values.csi.kubeletRootDir }} {{- if .Values.csi.kubeletRootDir }}
- name: KUBELET_ROOT_DIR - name: KUBELET_ROOT_DIR
value: {{ .Values.csi.kubeletRootDir }} value: {{ .Values.csi.kubeletRootDir }}

View File

@ -19,13 +19,7 @@ service:
type: ClusterIP type: ClusterIP
nodePort: "" nodePort: ""
# deploy either 'flexvolume' or 'csi' driver
driver: csi
persistence: persistence:
# for GKE uses /home/kubernetes/flexvolume/ instead, User can find the correct directory by running ps aux|grep kubelet on the host and check the --volume-plugin-dir parameter.
# If there is none, the default /usr/libexec/kubernetes/kubelet-plugins/volume/exec/ will be used.
flexvolumePath:
defaultClass: true defaultClass: true
defaultClassReplicaCount: 3 defaultClassReplicaCount: 3