diff --git a/helm/minio/templates/statefulset.yaml b/helm/minio/templates/statefulset.yaml index 186ab8d09..4965899b1 100644 --- a/helm/minio/templates/statefulset.yaml +++ b/helm/minio/templates/statefulset.yaml @@ -1,6 +1,7 @@ {{- if eq .Values.mode "distributed" }} {{ $poolCount := .Values.pools | int }} {{ $nodeCount := .Values.replicas | int }} +{{ $replicas := mul $poolCount $nodeCount }} {{ $drivesPerNode := .Values.drivesPerNode | int }} {{ $scheme := "http" }} {{- if .Values.tls.enabled }} @@ -57,7 +58,7 @@ spec: type: {{ .Values.StatefulSetUpdate.updateStrategy }} podManagementPolicy: "Parallel" serviceName: {{ template "minio.fullname" . }}-svc - replicas: {{ mul $poolCount $nodeCount }} + replicas: {{ $replicas }} selector: matchLabels: app: {{ template "minio.name" . }} @@ -168,6 +169,12 @@ spec: {{- with .Values.tolerations }} tolerations: {{ toYaml . | indent 8 }} + {{- end }} + {{- if and (gt $replicas 1) (ge .Capabilities.KubeVersion.Major "1") (ge .Capabilities.KubeVersion.Minor "19") }} + {{- with .Values.topologySpreadConstraints }} + topologySpreadConstraints: +{{ toYaml . | indent 8 }} + {{- end }} {{- end }} volumes: - name: minio-user diff --git a/helm/minio/values.yaml b/helm/minio/values.yaml index e332445f8..bc4e57198 100644 --- a/helm/minio/values.yaml +++ b/helm/minio/values.yaml @@ -226,6 +226,7 @@ consoleIngress: nodeSelector: {} tolerations: [] affinity: {} +topologySpreadConstraints: [] ## Add stateful containers to have security context, if enabled MinIO will run as this ## user and group NOTE: securityContext is only enabled if persistence.enabled=true