github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/deploy/helm/templates/storageprovider/s3.yaml (about) 1 apiVersion: storage.kubeblocks.io/v1alpha1 2 kind: StorageProvider 3 metadata: 4 name: s3 5 labels: 6 {{- include "kubeblocks.labels" . | nindent 4 }} 7 spec: 8 csiDriverName: ru.yandex.s3.csi 9 csiDriverSecretTemplate: | 10 accessKeyID: {{ `{{ index .Parameters "accessKeyId" }}` }} 11 secretAccessKey: {{ `{{ index .Parameters "secretAccessKey" }}` }} 12 {{ `{{- $region := index .Parameters "region" }}` }} 13 {{ `{{- $endpoint := index .Parameters "endpoint" }}` }} 14 {{ `{{- if not $endpoint }}` }} 15 {{ `{{- if hasPrefix "cn-" $region }}` }} 16 {{ `{{- $endpoint = (printf "https://s3.%s.amazonaws.com.cn" $region) }}` }} 17 {{ `{{- else }}` }} 18 {{ `{{- $endpoint = (printf "https://s3.%s.amazonaws.com" $region) }}` }} 19 {{ `{{- end }}` }} 20 {{ `{{- end }}` }} 21 endpoint: {{ `{{ $endpoint }}` }} 22 23 storageClassTemplate: | 24 provisioner: ru.yandex.s3.csi 25 parameters: 26 mounter: geesefs 27 # you can set mount options here, for example limit memory cache size (recommended) 28 options: {{ `{{ printf "--memory-limit 1000 --dir-mode 0777 --file-mode 0666 %s --region %s" (index .Parameters "mountOptions") (index .Parameters "region") }}` }} 29 bucket: {{ `{{ index .Parameters "bucket" }}` }} 30 csi.storage.k8s.io/provisioner-secret-name: {{ `{{ .CSIDriverSecretRef.Name }}` }} 31 csi.storage.k8s.io/provisioner-secret-namespace: {{ `{{ .CSIDriverSecretRef.Namespace }}` }} 32 csi.storage.k8s.io/controller-publish-secret-name: {{ `{{ .CSIDriverSecretRef.Name }}` }} 33 csi.storage.k8s.io/controller-publish-secret-namespace: {{ `{{ .CSIDriverSecretRef.Namespace }}` }} 34 csi.storage.k8s.io/node-stage-secret-name: {{ `{{ .CSIDriverSecretRef.Name }}` }} 35 csi.storage.k8s.io/node-stage-secret-namespace: {{ `{{ .CSIDriverSecretRef.Namespace }}` }} 36 csi.storage.k8s.io/node-publish-secret-name: {{ `{{ .CSIDriverSecretRef.Name }}` }} 37 csi.storage.k8s.io/node-publish-secret-namespace: {{ `{{ .CSIDriverSecretRef.Namespace }}` }} 38 39 datasafedConfigTemplate: | 40 [storage] 41 type = s3 42 provider = AWS 43 env_auth = false 44 access_key_id = {{ `{{ index .Parameters "accessKeyId" }}` }} 45 secret_access_key = {{ `{{ index .Parameters "secretAccessKey" }}` }} 46 region = {{ `{{ index .Parameters "region" }}` }} 47 endpoint = {{ `{{ index .Parameters "endpoint" }}` }} 48 root = {{ `{{ index .Parameters "bucket" }}` }} 49 chunk_size = 50Mi 50 51 parametersSchema: 52 openAPIV3Schema: 53 type: "object" 54 properties: 55 region: 56 type: string 57 description: "AWS region, e.g. us-west-1" 58 bucket: 59 type: string 60 description: "S3 bucket" 61 endpoint: 62 type: string 63 description: "S3 endpoint (optional)" 64 mountOptions: 65 type: string 66 description: "mount options for geesefs" 67 accessKeyId: 68 type: string 69 description: "AWS access key" 70 secretAccessKey: 71 type: string 72 description: "AWS secret key" 73 74 required: 75 - bucket 76 - region 77 - accessKeyId 78 - secretAccessKey 79 80 credentialFields: 81 - accessKeyId 82 - secretAccessKey