From 2186f46ea349bbb721a2a7ca669a4505c8cd6034 Mon Sep 17 00:00:00 2001 From: Juri Malinovski Date: Tue, 23 Dec 2025 14:36:33 +0200 Subject: [PATCH] helm: fix service/containers ports, fix podAntiAffinity (#1230) Co-authored-by: majinghe <42570491+majinghe@users.noreply.github.com> --- helm/README.md | 6 ++++-- helm/rustfs/templates/_helpers.tpl | 4 ++-- helm/rustfs/templates/deployment.yaml | 8 ++++---- helm/rustfs/templates/statefulset.yaml | 10 +++++----- helm/rustfs/templates/tests/test-connection.yaml | 2 +- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/helm/README.md b/helm/README.md index a9725f9c..95515d27 100644 --- a/helm/README.md +++ b/helm/README.md @@ -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.rustfs.access_key | string | `"rustfsadmin"` | RustFS Access 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.console.nodePort | int | `32001` | | +| service.console.port | int | `9001` | | +| service.endpoint.nodePort | int | `32000` | | +| service.endpoint.port | int | `9000` | | | serviceAccount.annotations | object | `{}` | | | serviceAccount.automount | bool | `true` | | | serviceAccount.create | bool | `true` | | diff --git a/helm/rustfs/templates/_helpers.tpl b/helm/rustfs/templates/_helpers.tpl index 0b4a1b4f..c9ab646b 100644 --- a/helm/rustfs/templates/_helpers.tpl +++ b/helm/rustfs/templates/_helpers.tpl @@ -104,10 +104,10 @@ Render RUSTFS_VOLUMES */}} {{- define "rustfs.volumes" -}} {{- 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 }} {{- 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 }} diff --git a/helm/rustfs/templates/deployment.yaml b/helm/rustfs/templates/deployment.yaml index d19fc0a3..d804857f 100644 --- a/helm/rustfs/templates/deployment.yaml +++ b/helm/rustfs/templates/deployment.yaml @@ -83,10 +83,10 @@ spec: {{- toYaml .Values.containerSecurityContext | nindent 12 }} {{- end }} ports: - - containerPort: {{ .Values.service.ep_port }} - name: endpoint - - containerPort: {{ .Values.service.console_port }} - name: console + - name: endpoint + containerPort: {{ .Values.service.endpoint.port }} + - name: console + containerPort: {{ .Values.service.console.port }} envFrom: - configMapRef: name: {{ include "rustfs.fullname" . }}-config diff --git a/helm/rustfs/templates/statefulset.yaml b/helm/rustfs/templates/statefulset.yaml index a9b07b54..9a5230bb 100644 --- a/helm/rustfs/templates/statefulset.yaml +++ b/helm/rustfs/templates/statefulset.yaml @@ -42,6 +42,7 @@ spec: {{- else }} {} {{- if .Values.affinity.podAntiAffinity.enabled }} + {{- end }} podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: @@ -52,7 +53,6 @@ spec: - {{ include "rustfs.name" . }} topologyKey: {{ .Values.affinity.podAntiAffinity.topologyKey }} {{- end }} - {{- end }} {{- end }} {{- if .Values.tolerations }} tolerations: @@ -111,10 +111,10 @@ spec: {{- toYaml .Values.containerSecurityContext | nindent 12 }} {{- end }} ports: - - containerPort: {{ .Values.service.ep_port }} - name: endpoint - - containerPort: {{ .Values.service.console_port }} - name: console + - name: endpoint + containerPort: {{ .Values.service.endpoint.port }} + - name: console + containerPort: {{ .Values.service.console.port }} envFrom: - configMapRef: name: {{ include "rustfs.fullname" . }}-config diff --git a/helm/rustfs/templates/tests/test-connection.yaml b/helm/rustfs/templates/tests/test-connection.yaml index 428fc9b5..ee879f85 100644 --- a/helm/rustfs/templates/tests/test-connection.yaml +++ b/helm/rustfs/templates/tests/test-connection.yaml @@ -11,5 +11,5 @@ spec: - name: wget image: busybox 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