forked from apecloud/kubeblocks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Supports path-style s3 access. apecloud#8867
- Loading branch information
Showing
1 changed file
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |