diff --git a/helm/esdk/templates/huawei-csi-controller.yaml b/helm/esdk/templates/huawei-csi-controller.yaml index 860e3169..6b4e5302 100644 --- a/helm/esdk/templates/huawei-csi-controller.yaml +++ b/helm/esdk/templates/huawei-csi-controller.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: labels: - provisioner: csi.huawei.com + provisioner: {{.Values.csi_driver.driverName }} name: huawei-csi-controller namespace: {{ .Values.kubernetes.namespace }} --- @@ -11,7 +11,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: labels: - provisioner: csi.huawei.com + provisioner: {{.Values.csi_driver.driverName }} name: huawei-csi-attacher-role-cfg namespace: {{ .Values.kubernetes.namespace }} roleRef: @@ -27,7 +27,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: labels: - provisioner: csi.huawei.com + provisioner: {{.Values.csi_driver.driverName }} name: huawei-csi-attacher-cfg namespace: {{ .Values.kubernetes.namespace }} rules: @@ -47,7 +47,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: labels: - provisioner: csi.huawei.com + provisioner: {{.Values.csi_driver.driverName }} name: huawei-csi-provisioner-role-cfg namespace: {{ .Values.kubernetes.namespace }} roleRef: @@ -63,7 +63,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: labels: - provisioner: csi.huawei.com + provisioner: {{.Values.csi_driver.driverName }} name: huawei-csi-provisioner-cfg namespace: {{ .Values.kubernetes.namespace }} rules: @@ -118,12 +118,12 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: labels: - provisioner: csi.huawei.com - name: huawei-csi-provisioner-role + provisioner: {{.Values.csi_driver.driverName }} + name: {{.Values.kubernetes.namespace }}-provisioner-role roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: huawei-csi-provisioner-runner + name: {{.Values.kubernetes.namespace }}-provisioner-runner subjects: - kind: ServiceAccount name: huawei-csi-controller @@ -218,8 +218,8 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: labels: - provisioner: csi.huawei.com - name: huawei-csi-attacher-role + provisioner: {{.Values.csi_driver.driverName }} + name: {{.Values.kubernetes.namespace }}-attacher-role roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole @@ -276,7 +276,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: labels: - provisioner: csi.huawei.com + provisioner: {{.Values.csi_driver.driverName }} name: huawei-csi-csi-resizer-role-cfg namespace: {{ .Values.kubernetes.namespace }} roleRef: @@ -292,7 +292,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: labels: - provisioner: csi.huawei.com + provisioner: {{.Values.csi_driver.driverName }} name: huawei-csi-resizer-cfg namespace: {{ .Values.kubernetes.namespace }} rules: @@ -312,8 +312,8 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: labels: - provisioner: csi.huawei.com - name: huawei-csi-csi-resizer-role + provisioner: {{.Values.csi_driver.driverName }} + name: {{.Values.kubernetes.namespace }}-csi-resizer-role roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole @@ -327,8 +327,8 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: labels: - provisioner: csi.huawei.com - name: huawei-csi-resizer-runner + provisioner: {{.Values.csi_driver.driverName }} + name: {{.Values.kubernetes.namespace }}-resizer-runner rules: - apiGroups: - "" @@ -380,8 +380,8 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: labels: - provisioner: csi.huawei.com - name: huawei-csi-csi-snapshotter-role + provisioner: {{.Values.csi_driver.driverName }} + name: {{.Values.kubernetes.namespace }}-csi-snapshotter-role roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole @@ -395,8 +395,8 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: labels: - provisioner: csi.huawei.com - name: huawei-csi-snapshotter-runner + provisioner: {{.Values.csi_driver.driverName }} + name: {{.Values.kubernetes.namespace }}-snapshotter-runner rules: - apiGroups: - "" @@ -440,8 +440,8 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: labels: - provisioner: csi.huawei.com - name: huawei-csi-snapshot-controller-role + provisioner: {{.Values.csi_driver.driverName }} + name: {{.Values.kubernetes.namespace }}-snapshot-controller-role roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole @@ -455,8 +455,8 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: labels: - provisioner: csi.huawei.com - name: huawei-csi-snapshot-controller-runner + provisioner: {{.Values.csi_driver.driverName }} + name: {{.Values.kubernetes.namespace }}-snapshot-controller-runner rules: - apiGroups: - "" @@ -550,7 +550,7 @@ apiVersion: apps/v1 kind: Deployment metadata: labels: - provisioner: csi.huawei.com + provisioner: {{.Values.csi_driver.driverName }} name: huawei-csi-controller namespace: {{ .Values.kubernetes.namespace }} spec: @@ -558,12 +558,12 @@ spec: selector: matchLabels: app: huawei-csi-controller - provisioner: csi.huawei.com + provisioner: {{.Values.csi_driver.driverName }} template: metadata: labels: app: huawei-csi-controller - provisioner: csi.huawei.com + provisioner: {{.Values.csi_driver.driverName }} spec: containers: - args: @@ -673,6 +673,18 @@ spec: name: secret hostNetwork: true serviceAccount: huawei-csi-controller + {{- with .Values.topology.huaweiCsiNodeSelector }} + nodeSelector: + {{ toYaml . |nindent 8}} + {{- end}} + {{- with .Values.topology.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.huaweiImagePullSecrets}} + imagePullSecrets: + {{ toYaml . |nindent 8}} + {{- end}} volumes: - emptyDir: null name: socket-dir diff --git a/helm/esdk/templates/huawei-csi-driver.yaml b/helm/esdk/templates/huawei-csi-driver.yaml new file mode 100644 index 00000000..8ac86277 --- /dev/null +++ b/helm/esdk/templates/huawei-csi-driver.yaml @@ -0,0 +1,6 @@ +apiVersion: storage.k8s.io/v1 +kind: CSIDriver +metadata: + name: {{ .Values.csi_driver.driverName }} +spec: + fsGroupPolicy: {{ .Values.csi_driver.fsGroupPolicy }} \ No newline at end of file diff --git a/helm/esdk/templates/huawei-csi-node.yaml b/helm/esdk/templates/huawei-csi-node.yaml index 7bd19f9b..1aba0fcf 100644 --- a/helm/esdk/templates/huawei-csi-node.yaml +++ b/helm/esdk/templates/huawei-csi-node.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: labels: - provisioner: csi.huawei.com + provisioner: {{.Values.csi_driver.driverName }} name: huawei-csi-node namespace: {{ .Values.kubernetes.namespace }} --- @@ -11,8 +11,8 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: labels: - provisioner: csi.huawei.com - name: huawei-csi-driver-registrar-role + provisioner: {{.Values.csi_driver.driverName }} + name: {{.Values.kubernetes.namespace }}-driver-registrar-role roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole @@ -26,8 +26,8 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: labels: - provisioner: csi.huawei.com - name: huawei-csi-driver-registrar-runner + provisioner: {{.Values.csi_driver.driverName }} + name: {{.Values.kubernetes.namespace }}-driver-registrar-runner rules: - apiGroups: - "" @@ -64,19 +64,19 @@ apiVersion: apps/v1 kind: DaemonSet metadata: labels: - provisioner: csi.huawei.com + provisioner: {{.Values.csi_driver.driverName }} name: huawei-csi-node namespace: {{ .Values.kubernetes.namespace }} spec: selector: matchLabels: app: huawei-csi-node - provisioner: csi.huawei.com + provisioner: {{.Values.csi_driver.driverName }} template: metadata: labels: app: huawei-csi-node - provisioner: csi.huawei.com + provisioner: {{.Values.csi_driver.driverName }} spec: containers: - args: @@ -90,7 +90,7 @@ spec: name: socket-dir - args: - --csi-address=/csi/csi.sock - - --kubelet-registration-path=/var/lib/kubelet/plugins/csi.huawei.com/csi.sock + - --kubelet-registration-path=/var/lib/kubelet/plugins/{{.Values.csi_driver.driverName}}/csi.sock image: {{ .Values.images.sidecar.registrar }} imagePullPolicy: {{ .Values.sidecarImagePullPolicy }} name: csi-node-driver-registrar @@ -173,9 +173,21 @@ spec: hostNetwork: true hostPID: true serviceAccountName: huawei-csi-node + {{- with .Values.topology.huaweiCsiNodeSelector }} + nodeSelector: + {{ toYaml . |nindent 8}} + {{- end}} + {{- with .Values.topology.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.huaweiImagePullSecrets}} + imagePullSecrets: + {{ toYaml . |nindent 8}} + {{- end}} volumes: - hostPath: - path: /var/lib/kubelet/plugins/csi.huawei.com + path: /var/lib/kubelet/plugins/{{.Values.csi_driver.driverName}} type: DirectoryOrCreate name: socket-dir - hostPath: diff --git a/helm/esdk/values.yaml b/helm/esdk/values.yaml index bd8b94cd..37327e57 100644 --- a/helm/esdk/values.yaml +++ b/helm/esdk/values.yaml @@ -45,6 +45,8 @@ kubernetes: csi_driver: # Driver name, it is strongly recommended not to modify this parameter driverName: csi.huawei.com + # indicate whether or not they support modifying a volume's ownership or permissions when the volume is being mounted. + fsGroupPolicy: ReadWriteOnceWithFSType # Endpoint, it is strongly recommended not to modify this parameter endpoint: /csi/csi.sock # Maximum number of concurrent disk scans or detaches, support 1~10 @@ -84,5 +86,17 @@ csi_driver: # Maximum number of log files that can be backed up. maxBackups: 9 +# Number of huawei-csi-controllers +huaweiCsiController: + # Currently, the value can only be set to 1 + replicas: 1 +topology: + huaweiCsiNodeSelector: {} + tolerations: [] +# Image pull secret if image stored in private repository +huaweiImagePullSecrets: [] +# Flag to enable or disable resize (Optional) +resizer: + enable: true