Skip to content

Commit

Permalink
fix: Supports path-style s3 access. apecloud#8867
Browse files Browse the repository at this point in the history
  • Loading branch information
leonliao committed Jan 24, 2025
1 parent 851f1b8 commit be1a571
Showing 1 changed file with 87 additions and 0 deletions.
87 changes: 87 additions & 0 deletions deploy/helm/templates/storageprovider/s3-compatible.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
apiVersion: dataprotection.kubeblocks.io/v1alpha1
kind: StorageProvider
metadata:
name: s3-compatible
labels:
{{- include "kubeblocks.labels" . | nindent 4 }}
spec:
csiDriverName: ru.yandex.s3.csi
csiDriverSecretTemplate: |
accessKeyID: {{ `{{ index .Parameters "accessKeyId" }}` }}
secretAccessKey: {{ `{{ index .Parameters "secretAccessKey" }}` }}
endpoint: {{ `{{ index .Parameters "endpoint" }}` }}
storageClassTemplate: |
provisioner: ru.yandex.s3.csi
parameters:
mounter: geesefs
# you can set mount options here, for example limit memory cache size (recommended)
options: {{ `{{ printf "--memory-limit %s --read-ahead-large %s --dir-mode 0777 --file-mode 0666 %s" .Parameters.geesefsMemoryLimit .Parameters.geesefsReadAheadLarge .Parameters.mountOptions }}` }}
bucket: {{ `{{ index .Parameters "bucket" }}` }}
csi.storage.k8s.io/provisioner-secret-name: {{ `{{ .CSIDriverSecretRef.Name }}` }}
csi.storage.k8s.io/provisioner-secret-namespace: {{ `{{ .CSIDriverSecretRef.Namespace }}` }}
csi.storage.k8s.io/controller-publish-secret-name: {{ `{{ .CSIDriverSecretRef.Name }}` }}
csi.storage.k8s.io/controller-publish-secret-namespace: {{ `{{ .CSIDriverSecretRef.Namespace }}` }}
csi.storage.k8s.io/node-stage-secret-name: {{ `{{ .CSIDriverSecretRef.Name }}` }}
csi.storage.k8s.io/node-stage-secret-namespace: {{ `{{ .CSIDriverSecretRef.Namespace }}` }}
csi.storage.k8s.io/node-publish-secret-name: {{ `{{ .CSIDriverSecretRef.Name }}` }}
csi.storage.k8s.io/node-publish-secret-namespace: {{ `{{ .CSIDriverSecretRef.Namespace }}` }}
datasafedConfigTemplate: |
[storage]
type = s3
provider = Other
env_auth = false
access_key_id = {{ `{{ index .Parameters "accessKeyId" }}` }}
secret_access_key = {{ `{{ index .Parameters "secretAccessKey" }}` }}
endpoint = {{ `{{ index .Parameters "endpoint" }}` }}
root = {{ `{{ index .Parameters "bucket" }}` }}
no_check_certificate = {{ `{{ index .Parameters "insecure" }}` }}
chunk_size = 50Mi
force_path_style = {{ `{{ index .Parameters "usePathStyle" }}` }}
parametersSchema:
openAPIV3Schema:
type: "object"
properties:
bucket:
type: string
description: "S3 bucket"
endpoint:
type: string
description: "S3 endpoint (optional)"
mountOptions:
type: string
description: "Extra mount options for geesefs"
geesefsMemoryLimit:
type: integer
default: 512
description: "The value of --memory-limit parameter for geesefs, in MB"
geesefsReadAheadLarge:
type: integer
default: 20480
description: "The value of --read-ahead-large parameter for geesefs, in KB"
accessKeyId:
type: string
description: "AWS access key"
secretAccessKey:
type: string
description: "AWS secret key"
insecure:
type: boolean
default: false
description: "Do not verify the server SSL certificate"
usePathStyle:
type: boolean
default: false
description: "If set to false, use virtual hosted-style access. If set to true, use path-style access."

required:
- bucket
- region
- accessKeyId
- secretAccessKey

credentialFields:
- accessKeyId
- secretAccessKey

0 comments on commit be1a571

Please sign in to comment.