Skip to content

Commit

Permalink
Update local-pv documentation (#383)
Browse files Browse the repository at this point in the history
* Update local-pv documentation

Signed-off-by: Aylei <rayingecho@gmail.com>
  • Loading branch information
aylei authored and weekface committed Apr 16, 2019
1 parent 721531e commit 8e56b41
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,22 @@ Use this command to confirm the mount point exist:
$ mount | grep /mnt/disks/local-pv01
```

To auto-mount disks when your operating system is booted, you should edit `/etc/fstab` to include these mounting info:
### Auto-mount on reboot

To auto-mount disks when your operating system is booted, you should edit `/etc/fstab` to include these mounting info.

Disk mount:
```shell
$ echo "/dev/nvme0n1 /mnt/disks/disk01 ext4 defaults 0 0" >> /etc/fstab
```

Bind mount:
```shell
$ echo "/dev/nvme0n1 /mnt/disks/disk0 none bind 0 0" >> /etc/fstab
$ echo "/data/local-pv01 /mnt/disks/local-pv01 none bind 0 0" >> /etc/fstab
```

### Deploy local-static-provisioner

After mounting all data disks on Kubernetes nodes, you can deploy [local-volume-provisioner](https://github.com/kubernetes-sigs/sig-storage-local-static-provisioner) to automatically provision the mounted disks as Local PersistentVolumes.

```shell
Expand All @@ -106,6 +115,20 @@ $ kubectl get po -n kube-system -l app=local-volume-provisioner
$ kubectl get pv | grep local-storage
```

### Remove a mount point

If we want to remove a mount point, first we need to `umount` the mount point, and then delete the related directories. For example:

```shell
$ umount /mnt/disks/local-pv01
$ rm -rf /mnt/disks/local-pv01
$ rm -rf /data/local-pv01
```

You should also delete the related entries in `/etc/fstab` at the same time, otherwise the automount may cause problems when the machine restarts.

> Note: The local-volume plugin expects paths to be stable, if you remove a previous mount-point in the discovery directory (default to `/mnt/disks/`), you should remove the PV manually to keep consistency.
## Install TiDB Operator

TiDB Operator uses [CRD](https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/) to extend Kubernetes, so to use TiDB Operator, you should first create `TidbCluster` custom resource kind. This is a one-time job, namely you can only need to do this once in your Kubernetes cluster.
Expand Down

0 comments on commit 8e56b41

Please sign in to comment.