Update uninstallation procedure, synchronize chart doc
This commit is contained in:
parent
7c52609cc1
commit
6454bd3fa8
25
README.md
25
README.md
@ -260,21 +260,26 @@ See [here](./docs/troubleshooting.md) for the troubleshooting guide.
|
||||
|
||||
## Uninstall Longhorn
|
||||
|
||||
Longhorn stores its data in the Kubernetes API server, in the format of CRD. Longhorn CRDs have finalizers; user should delete the volumes and related resource first to give the managers a chance to clean up.
|
||||
|
||||
Before uninstalling Longhorn, the user need to delete all the PVC and PV resources which refer to a Longhorn volume in Kubernetes. Otherwise, Kubernetes may get confused because the underlying storage is gone but the PV/PVC remains.
|
||||
|
||||
### 1. Run cleanup script
|
||||
Note that you will lose all volume data after done this. If you intend on keeping any volume data, make backups (and test restoring a volume) before proceeding.
|
||||
1. To prevent damage to the Kubernetes cluster, we recommend deleting all Kubernetes workloads using Longhorn volumes (PersistentVolume, PersistentVolumeClaim, StorageClass, Deployment, StatefulSet, DaemonSet, etc).
|
||||
|
||||
2. Create the uninstallation job to cleanly purge CRDs from the system and wait for success:
|
||||
```
|
||||
curl -sSfL https://raw.githubusercontent.com/rancher/longhorn-manager/master/deploy/scripts/cleanup.sh | bash
|
||||
kubectl create -f https://raw.githubusercontent.com/rancher/longhorn/master/deploy/uninstall.yaml
|
||||
kubectl -n longhorn-system get job/longhorn-uninstall -w
|
||||
```
|
||||
|
||||
### 2. Delete remaining components
|
||||
|
||||
The cleanup script removes most components, but leaves RBAC related resources and the `longhorn-system` Namespace behind. Run this command to remove these resources.
|
||||
Example output:
|
||||
```
|
||||
$ kubectl create -f https://raw.githubusercontent.com/rancher/longhorn/master/deploy/uninstall.yaml
|
||||
job.batch/longhorn-uninstall created
|
||||
$ kubectl -n longhorn-system get job/longhorn-uninstall -w
|
||||
NAME DESIRED SUCCESSFUL AGE
|
||||
longhorn-uninstall 1 0 3s
|
||||
longhorn-uninstall 1 1 45s
|
||||
^C
|
||||
```
|
||||
|
||||
3. Remove remaining components:
|
||||
```
|
||||
kubectl delete -f https://raw.githubusercontent.com/rancher/longhorn/master/deploy/longhorn.yaml
|
||||
```
|
||||
|
27
deploy/uninstall.yaml
Normal file
27
deploy/uninstall.yaml
Normal file
@ -0,0 +1,27 @@
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: longhorn-uninstall
|
||||
namespace: longhorn-system
|
||||
spec:
|
||||
activeDeadlineSeconds: 900
|
||||
backoffLimit: 1
|
||||
template:
|
||||
metadata:
|
||||
name: longhorn-uninstall
|
||||
spec:
|
||||
containers:
|
||||
- name: longhorn-uninstall
|
||||
image: rancher/longhorn-manager:v0.3.2
|
||||
imagePullPolicy: Always
|
||||
command:
|
||||
- longhorn-manager
|
||||
- uninstall
|
||||
- --force
|
||||
env:
|
||||
- name: POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
restartPolicy: OnFailure
|
||||
serviceAccountName: longhorn-service-account
|
@ -2,8 +2,6 @@
|
||||
|
||||
The following document pertains to running Longhorn from the Rancher 2.0 chart.
|
||||
|
||||
Noted it's recommended to install Longhorn app in a separate Rancher Project, e.g. `Storage` or `Longhorn`.
|
||||
|
||||
## Source Code
|
||||
|
||||
Longhorn is 100% open source software. Project source code is spread across a number of repos:
|
||||
@ -14,23 +12,17 @@ Longhorn is 100% open source software. Project source code is spread across a nu
|
||||
|
||||
## Prerequisites
|
||||
|
||||
1. Docker v1.13+
|
||||
2. 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. Make sure `curl`, `findmnt`, `grep`, `awk` and `blkid` has been installed in all nodes of the Kubernetes cluster.
|
||||
4. 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.
|
||||
1. Rancher v2.1+
|
||||
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.
|
||||
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.
|
||||
|
||||
## Uninstallation
|
||||
|
||||
**Do not attempt to immediately delete Longhorn App from Rancher UI. Longhorn propagates device mounts which can damage the host if not unmounted properly.** Follow this procedure instead.
|
||||
|
||||
1. To prevent damage to the Kubernetes cluster, we recommend deleting all Kubernetes workloads using Longhorn volumes (PersistentVolume, PersistentVolumeClaim, StorageClass, Deployment, StatefulSet, DaemonSet, etc).
|
||||
|
||||
2. [Rancher v2.0.x users only] From the `Cluster` tab, click `Launch kubectl` and run this command:
|
||||
```
|
||||
curl -sSfL https://raw.githubusercontent.com/rancher/longhorn-manager/master/deploy/scripts/cleanup.sh | bash
|
||||
```
|
||||
|
||||
3. From Rancher UI, navigate to `Catalog Apps` tab and delete Longhorn app.
|
||||
2. From Rancher UI, navigate to `Catalog Apps` tab and delete Longhorn app.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
@ -59,7 +51,7 @@ By default, Kubernetes uses `/usr/libexec/kubernetes/kubelet-plugins/volume/exec
|
||||
|
||||
Some vendors choose to change the directory for various reasons. For example, GKE uses `/home/kubernetes/flexvolume` instead.
|
||||
|
||||
If you don't know what the correct directory is for your cluster, please leave the Chart question blank.
|
||||
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.
|
||||
|
Loading…
Reference in New Issue
Block a user