forked from apecloud/kubeblocks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
storageclass.yaml
103 lines (103 loc) · 3.85 KB
/
storageclass.yaml
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
101
102
103
{{- $scName := (include "kubeblocks.defaultStorageClass" .) }}
{{- if and $scName .Values.storageClass.create }}
{{- $cloudProvider := (include "kubeblocks.cloudProvider" .) }}
{{- if eq $cloudProvider "aws" }}
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: {{ $scName }}
labels:
{{- include "kubeblocks.labels" . | nindent 4 }}
allowVolumeExpansion: true
parameters:
## parameters references: https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/master/docs/parameters.md
type: {{ .Values.storageClass.provider.aws.volumeType }} # io2, io1, gp3, gp2 are all SSD variant
"csi.storage.k8s.io/fstype": {{ .Values.storageClass.provider.aws.fsType | default "xfs" }}
provisioner: ebs.csi.aws.com
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
---
{{- else if eq $cloudProvider "gcp" }}
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: {{ $scName }}
labels:
{{- include "kubeblocks.labels" . | nindent 4 }}
allowVolumeExpansion: true
parameters:
## refer: https://github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/issues/617
type: {{ .Values.storageClass.provider.gcp.volumeType }}
csi.storage.k8s.io/fstype: {{ .Values.storageClass.provider.gcp.fsType | default "xfs" }}
provisioner: pd.csi.storage.gke.io
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
---
{{- else if eq $cloudProvider "aliyun" }}
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: {{ $scName }}
labels:
{{- include "kubeblocks.labels" . | nindent 4 }}
allowVolumeExpansion: true
parameters:
## parameters references: https://github.com/kubernetes-sigs/alibaba-cloud-csi-driver/blob/master/docs/disk.md
fstype: {{ .Values.storageClass.provider.aliyun.fsType | default "xfs" }}
type: {{ .Values.storageClass.provider.aliyun.volumeType }}
provisioner: diskplugin.csi.alibabacloud.com
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
---
{{- else if eq $cloudProvider "tencentCloud" }}
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: {{ $scName }}
labels:
{{- include "kubeblocks.labels" . | nindent 4 }}
parameters:
## parameters references: https://cloud.tencent.com/document/product/457/44239, the fsType is not supported by tke.
type: {{ .Values.storageClass.provider.tencentCloud.volumeType }}
reclaimPolicy: Delete
provisioner: com.tencent.cloud.csi.cbs
volumeBindingMode: WaitForFirstConsumer
---
{{- else if eq $cloudProvider "azure" }}
## it doesn't work here because aks does not support .Capabilities.KubeVersion.GitVersion to judge the provider.
## refer: https://github.com/Azure/AKS/issues/3375
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: {{ $scName }}
labels:
{{- include "kubeblocks.labels" . | nindent 4 }}
parameters:
# parameters references: https://github.com/kubernetes-sigs/azuredisk-csi-driver/blob/master/docs/driver-parameters.md
fsType: {{ .Values.storageClass.provider.azure.fsType | default "xfs" }}
kind: {{ .Values.storageClass.provider.azure.volumeType }}
skuName: Standard_LRS
provisioner: kubernetes.io/azure-disk
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
---
{{- else if eq $cloudProvider "huaweiCloud" }} # huawei cloud
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: {{ $scName }}
labels:
{{- include "kubeblocks.labels" . | nindent 4 }}
parameters:
# parameters references: https://support.huaweicloud.com/usermanual-cce/cce_10_0380.html#section3
csi.storage.k8s.io/csi-driver-name: disk.csi.everest.io
csi.storage.k8s.io/fstype: {{ .Values.storageClass.provider.huaweiCloud.fsType | default "xfs" }}
everest.io/disk-volume-type: {{ .Values.storageClass.provider.huaweiCloud.volumeType }}
everest.io/passthrough: "true"
provisioner: everest-csi-provisioner
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
---
{{- end }}
{{- end }}