Skip to content

Commit

Permalink
chore: make csi-s3 compatible with the huawei cloud (#5424)
Browse files Browse the repository at this point in the history
(cherry picked from commit 097cdea)
  • Loading branch information
zjx20 committed Oct 13, 2023
1 parent 416da5a commit d95b0f3
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
6 changes: 3 additions & 3 deletions deploy/csi-s3/templates/attacher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ spec:
- "--csi-address=$(ADDRESS)"
env:
- name: ADDRESS
value: /var/lib/kubelet/plugins/ru.yandex.s3.csi/csi.sock
value: {{ .Values.kubeletPath }}/plugins/ru.yandex.s3.csi/csi.sock
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: socket-dir
mountPath: /var/lib/kubelet/plugins/ru.yandex.s3.csi
mountPath: {{ .Values.kubeletPath }}/plugins/ru.yandex.s3.csi
volumes:
- name: socket-dir
hostPath:
path: /var/lib/kubelet/plugins/ru.yandex.s3.csi
path: {{ .Values.kubeletPath }}/plugins/ru.yandex.s3.csi
type: DirectoryOrCreate
{{- end -}}
10 changes: 5 additions & 5 deletions deploy/csi-s3/templates/csi-s3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ spec:
- name: ADDRESS
value: /csi/csi.sock
- name: DRIVER_REG_SOCK_PATH
value: /var/lib/kubelet/plugins/ru.yandex.s3.csi/csi.sock
value: {{ .Values.kubeletPath }}/plugins/ru.yandex.s3.csi/csi.sock
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
Expand Down Expand Up @@ -104,22 +104,22 @@ spec:
- name: plugin-dir
mountPath: /csi
- name: pods-mount-dir
mountPath: /var/lib/kubelet/pods
mountPath: {{ .Values.kubeletPath }}/pods
mountPropagation: "Bidirectional"
- name: fuse-device
mountPath: /dev/fuse
volumes:
- name: registration-dir
hostPath:
path: /var/lib/kubelet/plugins_registry/
path: {{ .Values.kubeletPath }}/plugins_registry/
type: DirectoryOrCreate
- name: plugin-dir
hostPath:
path: /var/lib/kubelet/plugins/ru.yandex.s3.csi
path: {{ .Values.kubeletPath }}/plugins/ru.yandex.s3.csi
type: DirectoryOrCreate
- name: pods-mount-dir
hostPath:
path: /var/lib/kubelet/pods
path: {{ .Values.kubeletPath }}/pods
type: Directory
- name: fuse-device
hostPath:
Expand Down
8 changes: 4 additions & 4 deletions deploy/csi-s3/templates/provisioner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ spec:
- "--v=4"
env:
- name: ADDRESS
value: /var/lib/kubelet/plugins/ru.yandex.s3.csi/csi.sock
value: {{ .Values.kubeletPath }}/plugins/ru.yandex.s3.csi/csi.sock
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: socket-dir
mountPath: /var/lib/kubelet/plugins/ru.yandex.s3.csi
mountPath: {{ .Values.kubeletPath }}/plugins/ru.yandex.s3.csi
- name: csi-s3
image: {{ .Values.images.csi }}
imagePullPolicy: IfNotPresent
Expand All @@ -100,14 +100,14 @@ spec:
- "--v=4"
env:
- name: CSI_ENDPOINT
value: unix:///var/lib/kubelet/plugins/ru.yandex.s3.csi/csi.sock
value: unix://{{ .Values.kubeletPath }}/kubelet/plugins/ru.yandex.s3.csi/csi.sock
- name: NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- name: socket-dir
mountPath: /var/lib/kubelet/plugins/ru.yandex.s3.csi
mountPath: {{ .Values.kubeletPath }}/kubelet/plugins/ru.yandex.s3.csi
volumes:
- name: socket-dir
emptyDir: {}
Expand Down
3 changes: 3 additions & 0 deletions deploy/csi-s3/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,6 @@ csiName: s3

# Check if this CSI has been installed multiple times. if true, only install storageClass and secret.
multiCSI: false

# kubelet path in the host
kubeletPath: /var/lib/kubelet
6 changes: 6 additions & 0 deletions deploy/helm/templates/addons/csi-s3-addon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ spec:
- name: {{ include "kubeblocks.fullname" . }}-cloud-provider
key: csi-s3

{{- $cloudProvider := (include "kubeblocks.cloudProvider" .) }}
{{- if eq $cloudProvider "huaweiCloud" }}
setValues:
- kubeletPath=/mnt/paas/kubernetes/kubelet
{{- end }}

valuesMapping:
jsonMap:
tolerations: tolerations
Expand Down

0 comments on commit d95b0f3

Please sign in to comment.