Go to file
Harry Brundage d1ebf58fcf
Update CSI yaml to allow using k8s service DNS to contact the filer
I think lots of users are going to use the CSI driver with a seaweedfs cluster also running in k8s. The natural way to connect the driver to that cluster would be using DNS instead of hard coded IPs, so I set `SEAWEEDFS_FILER` to something like `seaweedfs-filer.seaweed-namespace.svc:8888`, which the driver kept timing out trying to connect. I realized the driver was running using `hostNetwork: true`, which means the in-cluster DNS resolution doesn't happen, so the .svc hostnames are just unresolved.

This changes the default YAML for the next person coming along to use the in-cluster DNS resolution first, and then the host's DNS resolution, so that if the filer happens to be running the cluster, it can be connected from the driver running on the host.

An alternative would be to not use `hostNetworking` for the driver daemonset, but I am presuming that's there for a reason.
2020-10-02 09:03:43 -04:00
cmd/seaweedfs-csi-driver Make Builder Platform agnostic 2020-06-14 12:17:56 +02:00
deploy/kubernetes Update CSI yaml to allow using k8s service DNS to contact the filer 2020-10-02 09:03:43 -04:00
pkg/driver auto created directory need to have open permission on k8s 2020-09-23 02:44:42 -07:00
.gitignore WIP 2020-03-19 02:59:45 -07:00
go.mod sync with seaweedfs repo with go get 2020-07-24 10:30:47 -07:00
go.sum sync with seaweedfs repo with go get 2020-07-24 10:30:47 -07:00
LICENSE add readme license 2020-06-07 21:58:02 -07:00
Makefile skip checking 2020-06-09 22:34:26 -07:00
README.md Update README.md 2020-07-24 22:25:39 -07:00

Container Storage Interface (CSI) for SeaweedFs

Docker Pulls

Container storage interface is an industry standard that will enable storage vendors to develop a plugin once and have it work across a number of container orchestration systems.

SeaweedFS is a simple and highly scalable distributed file system, to store and serve billions of files fast!

Deployment (Kubernetes)

Prerequisites:

  • Already have a working Kubernetes cluster (includes kubectl)
  • Already have a working SeaweedFS cluster

Utilize exiting SeaweedFS storage for your Kubernetes cluster (bare metal)

  1. Git clone this repository and add your SeaweedFS master IP to deploy/kubernetes/seaweedfs-csi.yaml (2 places)

  2. Apply the container storage interface for SeaweedFS for your cluster

$ kubectl apply -f deploy/kubernetes/seaweedfs-csi.yaml
  1. Ensure all the containers are ready and running
$ kubectl get po -n kube-system
  1. 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
  1. Verify if the persistant volume claim exists and wait until its the STATUS is Bound
$ kubectl get pvc
  1. After its in Bound state, create a sample workload mounting that volume
$ kubectl apply -f deploy/kubernetes/sample-busybox-pod.yaml
  1. Verify the storage mount of the busybox pod
$ kubectl exec my-csi-app -- df -h
  1. Clean up
$ 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

License

Apache v2 license

Code of conduct

Participation in this project is governed by Kubernetes/CNCF code of conduct