diff options
| -rw-r--r-- | README.md | 100 |
1 files changed, 73 insertions, 27 deletions
@@ -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: +<br> + +- [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) + +<br> + +# 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. 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) -1. Git clone this repository and adjust your SeaweedFS Filer address via variable SEAWEEDFS_FILER in `deploy/kubernetes/seaweedfs-csi.yaml` (2 places) +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. + +<br> -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: +### 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 + +<br> + +### 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 +<br> + +## 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=<filerHost:port> seaweedfs-csi-driver ./seaweedfs-csi-driver/deploy/helm/seaweedfs-csi-driver ``` -3. Clean up +<br> + +### Uninstall + ```bash helm uninstall seaweedfs-csi-driver ``` -# Safe rollout update +<br> + +# 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] + +<br> + +# 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 +``` + +<br> # Static and dynamic provisioning @@ -204,5 +248,7 @@ It is recommended to use [well-known labels](https://kubernetes.io/docs/referenc # License [Apache v2 license](https://www.apache.org/licenses/LICENSE-2.0) +<br> + # 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) |
