-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobs.yaml
More file actions
100 lines (95 loc) · 4.03 KB
/
obs.yaml
File metadata and controls
100 lines (95 loc) · 4.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# obs is a storage provider for [Huawei OBS](https://www.huaweicloud.com/product/obs.html) object storage.
apiVersion: dataprotection.kubeblocks.io/v1alpha1
kind: StorageProvider
metadata:
name: obs
spec:
csiDriverName: ru.yandex.s3.csi
csiDriverSecretTemplate: |
accessKeyID: {{ `{{ index .Parameters "accessKeyId" }}` }}
secretAccessKey: {{ `{{ index .Parameters "secretAccessKey" }}` }}
{{ `{{- $region := index .Parameters "region" }}` }}
{{ `{{- $endpoint := index .Parameters "endpoint" }}` }}
{{ `{{- if not $endpoint }}` }}
{{ `{{- $endpoint = (printf "https://obs.%s.myhuaweicloud.com" $region) }}` }}
{{ `{{- end }}` }}
endpoint: {{ `{{ $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 --subdomain" .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 = HuaweiOBS
env_auth = false
access_key_id = {{ `{{ index .Parameters "accessKeyId" }}` }}
secret_access_key = {{ `{{ index .Parameters "secretAccessKey" }}` }}
region = {{ `{{ index .Parameters "region" }}` }}
{{ `{{- $region := index .Parameters "region" }}` }}
{{ `{{- $endpoint := index .Parameters "endpoint" }}` }}
{{ `{{- if not $endpoint }}` }}
{{ `{{- $endpoint = (printf "obs.%s.myhuaweicloud.com" $region) }}` }}
{{ `{{- end }}` }}
endpoint = {{ `{{ $endpoint }}` }}
root = {{ `{{ index .Parameters "bucket" }}` }}
no_check_certificate = {{ `{{ index .Parameters "insecure" }}` }}
no_check_bucket = {{ `{{ index .Parameters "noCheckBucket" }}` }}
chunk_size = 50Mi
parametersSchema:
openAPIV3Schema:
type: "object"
properties:
region:
type: string
description: "OBS region, e.g. cn-north-4"
bucket:
type: string
description: "OBS bucket"
endpoint:
type: string
description: "OBS 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: "OBS access key"
secretAccessKey:
type: string
description: "OBS secret key"
insecure:
type: boolean
default: false
description: "Do not verify the server SSL certificate"
noCheckBucket:
type: boolean
default: false
description: "Do not check if the bucket exists, and do not try to create it"
required:
- bucket
- region
- accessKeyId
- secretAccessKey
credentialFields:
- accessKeyId
- secretAccessKey