From 316e6340aaa0fa8f9cac011b25063c1c7c67abbe Mon Sep 17 00:00:00 2001 From: Ruakij Date: Tue, 17 Jan 2023 15:15:06 +0100 Subject: Restructure Readme for better clarity and added index --- README.md | 102 +++++++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 75 insertions(+), 27 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 20ab423..6efdb8d 100644 --- a/README.md +++ b/README.md @@ -6,16 +6,40 @@ [SeaweedFS](https://github.com/seaweedfs/seaweedfs) is a simple and highly scalable distributed file system, to store and serve billions of files fast! -# Deployment (Kubernetes) -#### Prerequisites: +
+ +- [Deployment](#deployment) + - [Kubernetes (kubectl)](#kubernetes-kubectl) + - [Kubernetes (helm)](#kubernetes-helm) +- [Update (Safe rollout)](#update-safe-rollout) +- [Testing](#testing) +- [Static and dynamic provisioning](#static-and-dynamic-provisioning) +- [DataLocality](#datalocality) +- [License](#license) +- [Code of conduct](#code-of-conduct) + +
+ +# Deployment +## Kubernetes (kubectl) +### Prerequisites: * Already have a working Kubernetes cluster (includes `kubectl`) * Already have a working SeaweedFS cluster -## Utilize existing SeaweedFS storage for your Kubernetes cluster (bare metal) +### Install -1. Git clone this repository and adjust your SeaweedFS Filer address via variable SEAWEEDFS_FILER in `deploy/kubernetes/seaweedfs-csi.yaml` (2 places) +1. Clone this repository +```sh +git clone https://github.com/seaweedfs/seaweedfs-csi-driver.git +``` + +2. Adjust your SeaweedFS Filer address via variable SEAWEEDFS_FILER in `deploy/kubernetes/seaweedfs-csi.yaml` (2 places) -2. Apply the container storage interface for SeaweedFS for your cluster. Use the '-pre-1.17' version for any cluster pre kubernetes version 1.17. To generate an up to date manifest from the helm chart, do: +3. Apply the container storage interface for SeaweedFS for your cluster. Use the '-pre-1.17' version for any cluster pre kubernetes version 1.17. + +
+ +### To generate an up to date manifest from the helm chart, do: ``` $ helm template seaweedfs ./deploy/helm/seaweedfs-csi-driver > deploy/kubernetes/seaweedfs-csi.yaml @@ -24,50 +48,47 @@ Then apply the manifest. ``` $ kubectl apply -f deploy/kubernetes/seaweedfs-csi.yaml ``` -3. Ensure all the containers are ready and running +4. Ensure all the containers are ready and running ``` $ kubectl get po -n kube-system ``` -4. Testing: Create a persistant volume claim for 5GiB with name `seaweedfs-csi-pvc` with storage class `seaweedfs-storage`. The value, 5Gib does not have any significance as for SeaweedFS the whole filesystem is mounted into the container. -``` -$ kubectl apply -f deploy/kubernetes/sample-seaweedfs-pvc.yaml -``` -5. Verify if the persistant volume claim exists and wait until its the STATUS is `Bound` -``` -$ kubectl get pvc -``` -6. After its in `Bound` state, create a sample workload mounting that volume -``` -$ kubectl apply -f deploy/kubernetes/sample-busybox-pod.yaml -``` -7. Verify the storage mount of the busybox pod -``` -$ kubectl exec my-csi-app -- df -h -``` -8. Clean up + +
+ +### Uninstall + ``` $ kubectl delete -f deploy/kubernetes/sample-busybox-pod.yaml $ kubectl delete -f deploy/kubernetes/sample-seaweedfs-pvc.yaml $ kubectl delete -f deploy/kubernetes/seaweedfs-csi.yaml ``` -# Deployment by helm chart +
+ +## Kubernetes (helm) + +### Install 1. Clone project ```bash git clone https://github.com/seaweedfs/seaweedfs-csi-driver.git ``` -2. Install +2. Edit `./seaweedfs-csi-driver/deploy/helm/values.yaml` if required and Install ```bash helm install --set seaweedfsFiler= seaweedfs-csi-driver ./seaweedfs-csi-driver/deploy/helm/seaweedfs-csi-driver ``` -3. Clean up +
+ +### Uninstall + ```bash helm uninstall seaweedfs-csi-driver ``` -# Safe rollout update +
+ +# Update (Safe rollout) Updating seaweed-csi-driver DaemonSet (DS) will break processeses who implement fuse mount: newly created pods will not remount net device. @@ -79,6 +100,29 @@ For safe update set `node.updateStrategy.type: OnDelete` for manual update. Step 4. delete DS pod on node 5. uncordon or remove taint on node 6. repeat all steps on [all nodes] + +
+ +# Testing + +1. Create a persistant volume claim for 5GiB with name `seaweedfs-csi-pvc` with storage class `seaweedfs-storage`. The value, 5Gib does not have any significance as for SeaweedFS the whole filesystem is mounted into the container. +``` +$ kubectl apply -f deploy/kubernetes/sample-seaweedfs-pvc.yaml +``` +2. Verify if the persistant volume claim exists and wait until its the STATUS is `Bound` +``` +$ kubectl get pvc +``` +3. After its in `Bound` state, create a sample workload mounting that volume +``` +$ kubectl apply -f deploy/kubernetes/sample-busybox-pod.yaml +``` +4. Verify the storage mount of the busybox pod +``` +$ kubectl exec my-csi-app -- df -h +``` + +
# Static and dynamic provisioning @@ -141,8 +185,12 @@ spec: storage: 1Gi ``` +
+ # License [Apache v2 license](https://www.apache.org/licenses/LICENSE-2.0) +
+ # Code of conduct Participation in this project is governed by [Kubernetes/CNCF code of conduct](https://github.com/kubernetes/community/blob/master/code-of-conduct.md) -- cgit v1.2.3