Use volume ID as a prefix if the bucket is fixed in the storage class
With this, each volume will get its own prefix within the bucket if it is configured in the storage class. This also ensures backwards compatibility with older volumes that have been created in earlier versions of csi-s3.
This commit is contained in:
parent
68ef284b9b
commit
26cb1d95e8
17 changed files with 195 additions and 105 deletions
deploy/kubernetes/examples
17
deploy/kubernetes/examples/pod.yaml
Normal file
17
deploy/kubernetes/examples/pod.yaml
Normal file
|
@ -0,0 +1,17 @@
|
|||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: csi-s3-test-nginx
|
||||
namespace: default
|
||||
spec:
|
||||
containers:
|
||||
- name: csi-s3-test-nginx
|
||||
image: nginx
|
||||
volumeMounts:
|
||||
- mountPath: /var/lib/www/html
|
||||
name: webroot
|
||||
volumes:
|
||||
- name: webroot
|
||||
persistentVolumeClaim:
|
||||
claimName: csi-s3-pvc
|
||||
readOnly: false
|
12
deploy/kubernetes/examples/pvc.yaml
Normal file
12
deploy/kubernetes/examples/pvc.yaml
Normal file
|
@ -0,0 +1,12 @@
|
|||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: csi-s3-pvc
|
||||
namespace: default
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 5Gi
|
||||
storageClassName: csi-s3
|
12
deploy/kubernetes/examples/secret.yaml
Normal file
12
deploy/kubernetes/examples/secret.yaml
Normal file
|
@ -0,0 +1,12 @@
|
|||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
namespace: kube-system
|
||||
name: csi-s3-secret
|
||||
stringData:
|
||||
accessKeyID: <YOUR_ACCESS_KEY_ID>
|
||||
secretAccessKey: <YOUR_SECRET_ACCES_KEY>
|
||||
# For AWS set it to "https://s3.<region>.amazonaws.com"
|
||||
endpoint: https://s3.eu-central-1.amazonaws.com
|
||||
# If not on S3, set it to ""
|
||||
region: <S3_REGION>
|
20
deploy/kubernetes/examples/storageclass.yaml
Normal file
20
deploy/kubernetes/examples/storageclass.yaml
Normal file
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
kind: StorageClass
|
||||
apiVersion: storage.k8s.io/v1
|
||||
metadata:
|
||||
name: csi-s3
|
||||
provisioner: ch.ctrox.csi.s3-driver
|
||||
parameters:
|
||||
# specify which mounter to use
|
||||
# can be set to rclone, s3fs, goofys or s3backer
|
||||
mounter: rclone
|
||||
# to use an existing bucket, specify it here:
|
||||
# bucket: some-existing-bucket
|
||||
csi.storage.k8s.io/provisioner-secret-name: csi-s3-secret
|
||||
csi.storage.k8s.io/provisioner-secret-namespace: kube-system
|
||||
csi.storage.k8s.io/controller-publish-secret-name: csi-s3-secret
|
||||
csi.storage.k8s.io/controller-publish-secret-namespace: kube-system
|
||||
csi.storage.k8s.io/node-stage-secret-name: csi-s3-secret
|
||||
csi.storage.k8s.io/node-stage-secret-namespace: kube-system
|
||||
csi.storage.k8s.io/node-publish-secret-name: csi-s3-secret
|
||||
csi.storage.k8s.io/node-publish-secret-namespace: kube-system
|
Loading…
Add table
Add a link
Reference in a new issue