deploy: fix bug of ceph-csi-rbd helm chart

fix bug that make provisioner get dup affinities
when deploy helm chart ceph-csi-rbd and ceph-csi-cephfs.

Signed-off-by: DashJay <45532257+dashjay@users.noreply.github.com>
This commit is contained in:
DashJay 2023-04-17 07:45:22 +00:00 committed by mergify[bot]
parent f4f6b7ae60
commit 9df4634fd0
2 changed files with 16 additions and 8 deletions

View File

@ -48,6 +48,14 @@ spec:
values: values:
- {{ .Values.provisioner.name }} - {{ .Values.provisioner.name }}
topologyKey: "kubernetes.io/hostname" topologyKey: "kubernetes.io/hostname"
{{- if .Values.provisioner.affinity }}
{{ toYaml .Values.provisioner.affinity | indent 8 -}}
{{- end -}}
{{- else -}}
{{- if .Values.provisioner.affinity }}
affinity:
{{ toYaml .Values.provisioner.affinity | indent 8 -}}
{{- end -}}
{{- end }} {{- end }}
serviceAccountName: {{ include "ceph-csi-cephfs.serviceAccountName.provisioner" . }} serviceAccountName: {{ include "ceph-csi-cephfs.serviceAccountName.provisioner" . }}
hostNetwork: {{ .Values.provisioner.enableHostNetwork }} hostNetwork: {{ .Values.provisioner.enableHostNetwork }}
@ -228,10 +236,6 @@ spec:
emptyDir: { emptyDir: {
medium: "Memory" medium: "Memory"
} }
{{- if .Values.provisioner.affinity }}
affinity:
{{ toYaml .Values.provisioner.affinity | indent 8 -}}
{{- end -}}
{{- if .Values.provisioner.nodeSelector }} {{- if .Values.provisioner.nodeSelector }}
nodeSelector: nodeSelector:
{{ toYaml .Values.provisioner.nodeSelector | indent 8 -}} {{ toYaml .Values.provisioner.nodeSelector | indent 8 -}}

View File

@ -48,6 +48,14 @@ spec:
values: values:
- {{ .Values.provisioner.name }} - {{ .Values.provisioner.name }}
topologyKey: "kubernetes.io/hostname" topologyKey: "kubernetes.io/hostname"
{{- if .Values.provisioner.affinity }}
{{ toYaml .Values.provisioner.affinity | indent 8 -}}
{{- end -}}
{{- else -}}
{{- if .Values.provisioner.affinity }}
affinity:
{{ toYaml .Values.provisioner.affinity | indent 8 -}}
{{- end -}}
{{- end }} {{- end }}
serviceAccountName: {{ include "ceph-csi-rbd.serviceAccountName.provisioner" . }} serviceAccountName: {{ include "ceph-csi-rbd.serviceAccountName.provisioner" . }}
hostNetwork: {{ .Values.provisioner.enableHostNetwork }} hostNetwork: {{ .Values.provisioner.enableHostNetwork }}
@ -309,10 +317,6 @@ spec:
path: oidc-token path: oidc-token
expirationSeconds: 3600 expirationSeconds: 3600
audience: ceph-csi-kms audience: ceph-csi-kms
{{- if .Values.provisioner.affinity }}
affinity:
{{ toYaml .Values.provisioner.affinity | indent 8 -}}
{{- end -}}
{{- if .Values.provisioner.nodeSelector }} {{- if .Values.provisioner.nodeSelector }}
nodeSelector: nodeSelector:
{{ toYaml .Values.provisioner.nodeSelector | indent 8 -}} {{ toYaml .Values.provisioner.nodeSelector | indent 8 -}}