mirror of
https://github.com/minio/minio.git
synced 2024-12-26 07:05:55 -05:00
Allow topologySpreadConstraints configuration (#14684)
The default replica value is 16 (right now) which can lead to massive resource consumption on one node in smaller clusters. The idea for this addition is to allow users to specify how the pods (replicas) are being spread across the cluster. It gives more control over this Helm Release in smaller clusters where most worker nodes have taints. As this Kubernetes feature exists since Kubernetes 1.19 and is only useful for a replica count > 1, this was taken into account.
This commit is contained in:
parent
e7ac1ea54c
commit
0b605c3383
@ -1,6 +1,7 @@
|
|||||||
{{- if eq .Values.mode "distributed" }}
|
{{- if eq .Values.mode "distributed" }}
|
||||||
{{ $poolCount := .Values.pools | int }}
|
{{ $poolCount := .Values.pools | int }}
|
||||||
{{ $nodeCount := .Values.replicas | int }}
|
{{ $nodeCount := .Values.replicas | int }}
|
||||||
|
{{ $replicas := mul $poolCount $nodeCount }}
|
||||||
{{ $drivesPerNode := .Values.drivesPerNode | int }}
|
{{ $drivesPerNode := .Values.drivesPerNode | int }}
|
||||||
{{ $scheme := "http" }}
|
{{ $scheme := "http" }}
|
||||||
{{- if .Values.tls.enabled }}
|
{{- if .Values.tls.enabled }}
|
||||||
@ -57,7 +58,7 @@ spec:
|
|||||||
type: {{ .Values.StatefulSetUpdate.updateStrategy }}
|
type: {{ .Values.StatefulSetUpdate.updateStrategy }}
|
||||||
podManagementPolicy: "Parallel"
|
podManagementPolicy: "Parallel"
|
||||||
serviceName: {{ template "minio.fullname" . }}-svc
|
serviceName: {{ template "minio.fullname" . }}-svc
|
||||||
replicas: {{ mul $poolCount $nodeCount }}
|
replicas: {{ $replicas }}
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: {{ template "minio.name" . }}
|
app: {{ template "minio.name" . }}
|
||||||
@ -168,6 +169,12 @@ spec:
|
|||||||
{{- with .Values.tolerations }}
|
{{- with .Values.tolerations }}
|
||||||
tolerations:
|
tolerations:
|
||||||
{{ toYaml . | indent 8 }}
|
{{ 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 }}
|
{{- end }}
|
||||||
volumes:
|
volumes:
|
||||||
- name: minio-user
|
- name: minio-user
|
||||||
|
@ -226,6 +226,7 @@ consoleIngress:
|
|||||||
nodeSelector: {}
|
nodeSelector: {}
|
||||||
tolerations: []
|
tolerations: []
|
||||||
affinity: {}
|
affinity: {}
|
||||||
|
topologySpreadConstraints: []
|
||||||
|
|
||||||
## Add stateful containers to have security context, if enabled MinIO will run as this
|
## 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
|
## user and group NOTE: securityContext is only enabled if persistence.enabled=true
|
||||||
|
Loading…
Reference in New Issue
Block a user