Skip to content

Commit

Permalink
Merge pull request #54 from wunderio/feature/provisioner
Browse files Browse the repository at this point in the history
Provisioner support
  • Loading branch information
Rade333 authored Sep 3, 2024
2 parents 5c26393 + a3ff7e0 commit d206d44
Show file tree
Hide file tree
Showing 24 changed files with 302 additions and 308 deletions.
18 changes: 17 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# CHANGELOG

3.0.0:
- Dropping support for kubernetes versions < 1.20 due to [external provisioner](https://github.com/kubernetes-csi/external-provisioner?tab=readme-ov-file#compatibility)+ compatibility requirement.
- PersistentVolume provisioner support. Creation of PersistentVolume and using it in PersistentVolumeClaim via selector is still supported,
no migration is required.
If PersistentVolume was setting `remotePathSuffix`, it can be added to PVC annotations as `csi-rclone/storage-path` value now (namespace can be ommited if `pathPattern` includes it - `${.PVC.namespace}/${.PVC.annotations.csi-rclone/storage-path}`).
If PersistentVolume was setting umask parameter, it's possible to set it in PVC annotations as `csi-rclone/umask` value now.
- cluster-driver-registrar is not required anymore since deployment resources declare CSIDriver object and registrar is [deprecated](https://kubernetes-csi.github.io/docs/cluster-driver-registrar.html#deprecated).

2.0.0:
- rclone version v1.66.0
- Custom rclone build (directory markers) removed since it's available in the official binary now
- Separate cache paths for each mount process + cache removal on unmount
- Remote control API endpoint for each mount process, this allows transfer state and vfs upload buffer queue monitoring
- Delay rclone process shutdown until upload queue is empty (There's an additional timeout of 1 hour. That should be enough even for bigger files)
- Graceful failover for plugin preStart

1.3.0:
- Container init changed to tini
- rclone plugin version v1.59.2
- rclone version v1.59.2
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@ This project implements Container Storage Interface (CSI) plugin that allows usi

## Kubernetes cluster compatability
Works (tested):
- `deploy/kubernetes/1.19`: K8S>= 1.19.x (due to storage.k8s.io/v1 CSIDriver API)
- `deploy/kubernetes/1.13`: K8S 1.13.x - 1.21.x (storage.k8s.io/v1beta1 CSIDriver API)

Does not work:
- v1.12.7-gke.10, driver name csi-rclone not found in the list of registered CSI drivers
- `deploy/kubernetes/1.20`: K8S>= 1.20.x External provisioner requires kubernetes [1.20](https://github.com/kubernetes-csi/external-provisioner?tab=readme-ov-file#compatibility)+.
- Older driver versions (before v3.0.0) support kubernetes 1.13-1.19, but are not maintained.

## Installing CSI driver to kubernetes cluster
TLDR: ` kubectl apply -f deploy/kubernetes/1.19` (or `deploy/kubernetes/1.13` for older version)
TLDR: `kubectl apply -f deploy/kubernetes/1.20`

1. Set up storage backend. You can use [Minio](https://min.io/), Amazon S3 compatible cloud storage service.
i.e.
i.e (heads up - minio setup example is severly outdated).
```
helm upgrade --install --create-namespace --namespace minio minio minio/minio --version 6.0.5 --set resources.requests.memory=512Mi --set secretKey=SECRET_ACCESS_KEY --set accessKey=ACCESS_KEY_ID
```
Expand Down Expand Up @@ -91,6 +88,13 @@ Deploy example definition
> `kubectl apply -f example/kubernetes/nginx-example.yaml`

## PersistentVolumeClaim annotations

- `csi-rclone/umask` - `umask` parameter for `rclone mount`.
- [if configured in storageclass `parameters.pathPattern`] `csi-rclone/storage-path` - Secret name that contains rclone configuration.

Provisioning of other parameters is currently unsupported, create PersistentVolume resource with `volumeAttributes` to define them.

## Building plugin and creating image
Current code is referencing projects repository on github.com. If you fork the repository, you have to change go includes in several places (use search and replace).

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.0.0
v3.0.0
1 change: 1 addition & 0 deletions cmd/csi-rclone-plugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"flag"
"fmt"
"os"

"github.com/spf13/cobra"
"github.com/wunderio/csi-rclone/pkg/rclone"
)
Expand Down
66 changes: 0 additions & 66 deletions deploy/kubernetes/1.13/csi-controller-rbac.yaml

This file was deleted.

82 changes: 0 additions & 82 deletions deploy/kubernetes/1.13/csi-nodeplugin-rclone.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions deploy/kubernetes/1.13/csi-rclone-storageclass.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions deploy/kubernetes/1.19/_csi-rclone-namespace.yaml

This file was deleted.

54 changes: 0 additions & 54 deletions deploy/kubernetes/1.19/csi-controller-rclone.yaml

This file was deleted.

40 changes: 0 additions & 40 deletions deploy/kubernetes/1.19/csi-nodeplugin-rbac.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions deploy/kubernetes/1.19/csi-rclone-storageclass.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ metadata:
rules:
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "patch", "update", "create", "delete"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: [""]
resources: ["nodes"]
Expand All @@ -23,7 +26,7 @@ rules:
verbs: ["get", "list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"]
verbs: ["get", "list", "watch", "update"]
verbs: ["get", "list", "watch", "update", "create", "delete"]
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments/status"]
verbs: ["patch"]
Expand All @@ -32,7 +35,22 @@ rules:
verbs: ["get", "create", "update"]
- apiGroups: [""]
resources: ["events"]
verbs: ["create"]
verbs: ["list", "watch", "create", "update", "patch"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshots"]
verbs: ["get", "list"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotcontents"]
verbs: ["get", "list"]
- apiGroups: ["storage.k8s.io"]
resources: ["csinodes"]
verbs: ["get", "list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"]
verbs: ["get", "list", "watch"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
Loading

0 comments on commit d206d44

Please sign in to comment.