Commit 108364fb authored by Cyrill Troxler's avatar Cyrill Troxler
Browse files

Merge branch 's3ql_mounter'

parents a1659375 626f4511
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -125,13 +125,13 @@
  version = "v0.19.0"

[[projects]]
  branch = "master"
  name = "github.com/kubernetes-csi/csi-test"
  packages = [
    "pkg/sanity",
    "utils"
  ]
  revision = "6fed82d24d3a04c1814440d4178e7bf8ae9e67e6"
  revision = "718c9544f5e16cba31881333e0f9dff371663dea"
  version = "v0.3.0-1"

[[projects]]
  branch = "master"
@@ -334,6 +334,12 @@
  revision = "168a6198bcb0ef175f7dacec0b8691fc141dc9b8"
  version = "v1.13.0"

[[projects]]
  name = "gopkg.in/ini.v1"
  packages = ["."]
  revision = "358ee7663966325963d4e8b2e1fbd570c5195153"
  version = "v1.38.1"

[[projects]]
  name = "gopkg.in/yaml.v2"
  packages = ["."]
@@ -366,6 +372,6 @@
[solve-meta]
  analyzer-name = "dep"
  analyzer-version = 1
  inputs-digest = "6af116857c3619ed6bf4a8c17b479733db2897293cb13de205ece61f7726b2f4"
  inputs-digest = "659f47734b56af7fba146039231841e82cc4c3c95dff2814ec3688e967790a50"
  solver-name = "gps-cdcl"
  solver-version = 1
+5 −1
Original line number Diff line number Diff line
@@ -11,8 +11,8 @@
  version = "0.19.0"

[[constraint]]
  branch = "master"
  name = "github.com/kubernetes-csi/csi-test"
  version = "v0.3.0-1"

[[constraint]]
  branch = "master"
@@ -37,3 +37,7 @@
[prune]
  go-tests = true
  unused-packages = true

[[constraint]]
  name = "gopkg.in/ini.v1"
  version = "1.38.1"
+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@
PROJECT_DIR=/go/src/github.com/ctrox/csi-s3-driver
REGISTRY_NAME=ctrox
IMAGE_NAME=csi-s3-driver
IMAGE_VERSION=0.1.0
IMAGE_VERSION=0.2.0
IMAGE_TAG=$(REGISTRY_NAME)/$(IMAGE_NAME):$(IMAGE_VERSION)
TEST_IMAGE_TAG=$(REGISTRY_NAME)/$(IMAGE_NAME):test

@@ -27,7 +27,7 @@ test:
	docker build -t $(TEST_IMAGE_TAG) -f test/Dockerfile .
	docker run --rm --privileged -v $(PWD):$(PROJECT_DIR):ro -v /dev:/dev $(TEST_IMAGE_TAG)
container: build
	docker build -t $(IMAGE_TAG) -f cmd/s3driver/Dockerfile .
	docker build -t $(IMAGE_TAG) -f cmd/s3driver/Dockerfile.s3ql .
push: container
	docker push $(IMAGE_TAG)
clean:
+34 −13
Original line number Diff line number Diff line
# CSI for S3
This is a Container Storage Interface ([CSI](https://github.com/container-storage-interface/spec/blob/master/spec.md)) for S3 (or S3 compatible) storage. This can dynamically allocate buckets and mount them via a fuse mount into any container.

# Status
This is still very experimental and should not be used in any production environment. Unexpected data loss could occur depending on what mounter and S3 storage backend is being used.

# Kubernetes installation
## Requirements
* Kubernetes 1.10+
@@ -19,6 +22,12 @@ stringData:
  secretAccessKey: <YOUR_SECRET_ACCES_KEY>
  endpoint: <S3_ENDPOINT_URL
  region: <S3_REGION>
  # specify which mounter to use
  # can be set to s3fs, goofys or s3ql
  mounter: <MOUNTER>
  # Currently only for s3ql
  # If not using s3ql, set it to ""
  encryptionKey: <FS_ENCRYPTION_KEY>
```

## 2. Deploy the driver
@@ -62,20 +71,32 @@ If something does not work as expected, check the troubleshooting section below.

# Additional configuration
## Mounter
By default the driver will use [s3fs](https://github.com/s3fs-fuse/s3fs-fuse) to mount buckets. Alternatively you can configure the storage class to use [goofys](https://github.com/kahing/goofys) for mounting S3 buckets. Note that goofys has some drawbacks in regards to POSIX compliance but in return offers better Performance than s3fs.
As seen in the deployment example above, the driver can be configured to use one of these mounters to mount buckets:

To configure a storage class to use goofys, just set the `mounter` parameter to `goofys`
```yaml
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: csi-s3
provisioner: ch.ctrox.csi.s3-driver
parameters:
  mounter: goofys
  csiProvisionerSecretName: csi-s3-secret
  csiProvisionerSecretNamespace: kube-system
```
* [s3fs](https://github.com/s3fs-fuse/s3fs-fuse)
* [goofys](https://github.com/kahing/goofys)
* [s3ql](https://github.com/s3ql/s3ql)

All mounters have different strengths and weaknesses depending on your use case. Here are some characteristics which should help you choose a mounter:

### s3fs
* Large subset of POSIX
* Files can be viewed normally with any S3 client
* Does not support appends or random writes

### goofys
* Weak POSIX compatibility
* Performance first
* Files can be viewed normally with any S3 client
* Does not support appends or random writes

### s3ql
* (Almost) full POSIX compatibility
* Uses its own object format
* Files are not readable with other S3 clients
* Support appends
* Supports compression before upload
* Supports encryption before upload

# Limitations
As S3 is not a real file system there are some limitations to consider here. Depending on what mounter you are using, you will have different levels of POSIX compability. Also depending on what S3 storage backend you are using there are not always consistency guarantees. The detailed limitations can be found on the documentation of [s3fs](https://github.com/s3fs-fuse/s3fs-fuse#limitations) and [goofys](https://github.com/kahing/goofys#current-status).
+23 −0
Original line number Diff line number Diff line
FROM debian:stretch
LABEL maintainers="Cyrill Troxler <cyrilltroxler@gmail.com>"
LABEL description="s3 fuse csi plugin"
ARG S3QL_VERSION=release-2.28

RUN apt-get update && \
    apt-get install -y \
      s3fs wget psmisc procps python3 python3-setuptools \
      python3-dev python3-pip python3-llfuse pkg-config \
      sqlite3 libsqlite3-dev python3-apsw cython && \
    rm -rf /var/lib/apt/lists/*

RUN pip3 install defusedxml dugong requests pycrypto

WORKDIR /usr/src
RUN wget -q https://github.com/s3ql/s3ql/archive/${S3QL_VERSION}.tar.gz
RUN tar -xzf ${S3QL_VERSION}.tar.gz
WORKDIR /usr/src/s3ql-${S3QL_VERSION}
RUN python3 setup.py build_cython build_ext --inplace
RUN python3 setup.py install

COPY ./_output/s3driver /s3driver
ENTRYPOINT ["/s3driver"]
Loading