helm: fix service/containers ports, fix podAntiAffinity (#1230)

Co-authored-by: majinghe <42570491+majinghe@users.noreply.github.com>
This commit is contained in:
Juri Malinovski
2025-12-23 14:36:33 +02:00
committed by GitHub
parent add6453aea
commit 2186f46ea3
5 changed files with 16 additions and 14 deletions
+4 -2
View File
@@ -93,9 +93,11 @@ RustFS helm chart supports **standalone and distributed mode**. For standalone m
| secret.existingSecret | string | `""` | Use existing secret with a credentials. | | secret.existingSecret | string | `""` | Use existing secret with a credentials. |
| secret.rustfs.access_key | string | `"rustfsadmin"` | RustFS Access Key ID | | secret.rustfs.access_key | string | `"rustfsadmin"` | RustFS Access Key ID |
| secret.rustfs.secret_key | string | `"rustfsadmin"` | RustFS Secret Key ID | | secret.rustfs.secret_key | string | `"rustfsadmin"` | RustFS Secret Key ID |
| service.console_port | int | `9001` | |
| service.ep_port | int | `9000` | |
| service.type | string | `"NodePort"` | | | service.type | string | `"NodePort"` | |
| service.console.nodePort | int | `32001` | |
| service.console.port | int | `9001` | |
| service.endpoint.nodePort | int | `32000` | |
| service.endpoint.port | int | `9000` | |
| serviceAccount.annotations | object | `{}` | | | serviceAccount.annotations | object | `{}` | |
| serviceAccount.automount | bool | `true` | | | serviceAccount.automount | bool | `true` | |
| serviceAccount.create | bool | `true` | | | serviceAccount.create | bool | `true` | |
+2 -2
View File
@@ -104,10 +104,10 @@ Render RUSTFS_VOLUMES
*/}} */}}
{{- define "rustfs.volumes" -}} {{- define "rustfs.volumes" -}}
{{- if eq (int .Values.replicaCount) 4 }} {{- if eq (int .Values.replicaCount) 4 }}
{{- printf "http://%s-{0...%d}.%s-headless:%d/data/rustfs{0...%d}" (include "rustfs.fullname" .) (sub (.Values.replicaCount | int) 1) (include "rustfs.fullname" . ) (.Values.service.ep_port | int) (sub (.Values.replicaCount | int) 1) }} {{- printf "http://%s-{0...%d}.%s-headless:%d/data/rustfs{0...%d}" (include "rustfs.fullname" .) (sub (.Values.replicaCount | int) 1) (include "rustfs.fullname" . ) (.Values.service.endpoint.port | int) (sub (.Values.replicaCount | int) 1) }}
{{- end }} {{- end }}
{{- if eq (int .Values.replicaCount) 16 }} {{- if eq (int .Values.replicaCount) 16 }}
{{- printf "http://%s-{0...%d}.%s-headless:%d/data" (include "rustfs.fullname" .) (sub (.Values.replicaCount | int) 1) (include "rustfs.fullname" .) (.Values.service.ep_port | int) }} {{- printf "http://%s-{0...%d}.%s-headless:%d/data" (include "rustfs.fullname" .) (sub (.Values.replicaCount | int) 1) (include "rustfs.fullname" .) (.Values.service.endpoint.port | int) }}
{{- end }} {{- end }}
{{- end }} {{- end }}
+4 -4
View File
@@ -83,10 +83,10 @@ spec:
{{- toYaml .Values.containerSecurityContext | nindent 12 }} {{- toYaml .Values.containerSecurityContext | nindent 12 }}
{{- end }} {{- end }}
ports: ports:
- containerPort: {{ .Values.service.ep_port }} - name: endpoint
name: endpoint containerPort: {{ .Values.service.endpoint.port }}
- containerPort: {{ .Values.service.console_port }} - name: console
name: console containerPort: {{ .Values.service.console.port }}
envFrom: envFrom:
- configMapRef: - configMapRef:
name: {{ include "rustfs.fullname" . }}-config name: {{ include "rustfs.fullname" . }}-config
+5 -5
View File
@@ -42,6 +42,7 @@ spec:
{{- else }} {{- else }}
{} {}
{{- if .Values.affinity.podAntiAffinity.enabled }} {{- if .Values.affinity.podAntiAffinity.enabled }}
{{- end }}
podAntiAffinity: podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution: requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector: - labelSelector:
@@ -52,7 +53,6 @@ spec:
- {{ include "rustfs.name" . }} - {{ include "rustfs.name" . }}
topologyKey: {{ .Values.affinity.podAntiAffinity.topologyKey }} topologyKey: {{ .Values.affinity.podAntiAffinity.topologyKey }}
{{- end }} {{- end }}
{{- end }}
{{- end }} {{- end }}
{{- if .Values.tolerations }} {{- if .Values.tolerations }}
tolerations: tolerations:
@@ -111,10 +111,10 @@ spec:
{{- toYaml .Values.containerSecurityContext | nindent 12 }} {{- toYaml .Values.containerSecurityContext | nindent 12 }}
{{- end }} {{- end }}
ports: ports:
- containerPort: {{ .Values.service.ep_port }} - name: endpoint
name: endpoint containerPort: {{ .Values.service.endpoint.port }}
- containerPort: {{ .Values.service.console_port }} - name: console
name: console containerPort: {{ .Values.service.console.port }}
envFrom: envFrom:
- configMapRef: - configMapRef:
name: {{ include "rustfs.fullname" . }}-config name: {{ include "rustfs.fullname" . }}-config
@@ -11,5 +11,5 @@ spec:
- name: wget - name: wget
image: busybox image: busybox
command: ['wget'] command: ['wget']
args: ['-O', '/dev/null', '{{ include "rustfs.fullname" . }}-svc:{{ .Values.service.ep_port }}/health'] args: ['-O', '/dev/null', '{{ include "rustfs.fullname" . }}-svc:{{ .Values.service.endpoint.port }}/health']
restartPolicy: Never restartPolicy: Never