From 63fe3703bbff5f2e6a9f8d9cfb76ea11292ae960 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Wed, 22 Jun 2022 16:29:28 +0300 Subject: [PATCH] Include s3fs and rclone in Docker image, use Alpine base --- README.md | 24 ++++++++++++------------ cmd/s3driver/Dockerfile | 6 ++---- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index acd6ecc..89ff907 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This is a Container Storage Interface ([CSI](https://github.com/container-storag ### Requirements -* Kubernetes 1.13+ (CSI v1.0.0 compatibility) +* Kubernetes 1.17+ * Kubernetes has to allow privileged containers * Docker daemon must allow shared mounts (systemd flag `MountFlags=shared`) @@ -101,36 +101,36 @@ If the bucket is specified, it will still be created if it does not exist on the ### Mounter -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](https://github.com/gaul/are-we-consistent-yet#observed-consistency). +We **strongly recommend** to use the default mounter which is [GeeseFS](https://github.com/yandex-cloud/geesefs). -The driver can be configured to use one of these mounters to mount buckets: - -* [geesefs](https://github.com/yandex-cloud/geesefs) (recommended and default) -* [s3fs](https://github.com/s3fs-fuse/s3fs-fuse) -* [rclone](https://rclone.org/commands/rclone_mount) +However there is also support for two other backends: [s3fs](https://github.com/s3fs-fuse/s3fs-fuse) and [rclone](https://rclone.org/commands/rclone_mount). The mounter can be set as a parameter in the storage class. You can also create multiple storage classes for each mounter if you like. -Characteristics of different mounters (for more detailed information consult their own documentation): +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](https://github.com/gaul/are-we-consistent-yet#observed-consistency). + +You can check POSIX compatibility matrix here: https://github.com/yandex-cloud/geesefs#posix-compatibility-matrix. #### GeeseFS * Almost full POSIX compatibility * Good performance for both small and big files -* Files can be viewed normally with any S3 client +* Does not store file permissions and custom modification times #### s3fs * Almost full POSIX compatibility * Good performance for big files, poor performance for small files -* Files can be viewed normally with any S3 client +* Very slow for directories with a large number of files #### rclone -* Less POSIX compatible than s3fs +* Poor POSIX compatibility * Bad performance for big files, okayish performance for small files -* Files can be viewed normally with any S3 client * Doesn't create directory objects like s3fs or GeeseFS +* May hang :-) ## Troubleshooting diff --git a/cmd/s3driver/Dockerfile b/cmd/s3driver/Dockerfile index 508f1b5..6b3ac80 100644 --- a/cmd/s3driver/Dockerfile +++ b/cmd/s3driver/Dockerfile @@ -6,13 +6,11 @@ ADD . /build RUN go get -d -v ./... RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o ./s3driver ./cmd/s3driver -FROM debian:buster-slim +FROM alpine:3.16 LABEL maintainers="Vitaliy Filippov " LABEL description="csi-s3 slim image" -RUN apt-get update && \ - apt-get install -y ca-certificates && \ - rm -rf /var/lib/apt/lists/* +RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing s3fs-fuse rclone ADD https://github.com/yandex-cloud/geesefs/releases/latest/download/geesefs-linux-amd64 /usr/bin/geesefs RUN chmod 755 /usr/bin/geesefs