From 3af41cd37d9419d22b9e217b6c64551a102b9699 Mon Sep 17 00:00:00 2001 From: chel-ou <62134861+chel-ou@users.noreply.github.com> Date: Thu, 14 Jul 2022 23:28:34 +0200 Subject: [PATCH] helm: enable using different ports for minioAPIPort and minioConsolePort (#15259) --- helm/minio/templates/console-service.yaml | 2 +- helm/minio/templates/networkpolicy.yaml | 4 ++-- helm/minio/templates/service.yaml | 2 +- helm/minio/templates/statefulset.yaml | 1 + helm/minio/values.yaml | 8 ++++---- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/helm/minio/templates/console-service.yaml b/helm/minio/templates/console-service.yaml index f4b1294e5..46da35974 100644 --- a/helm/minio/templates/console-service.yaml +++ b/helm/minio/templates/console-service.yaml @@ -35,7 +35,7 @@ spec: {{- if (and (eq .Values.consoleService.type "NodePort") ( .Values.consoleService.nodePort)) }} nodePort: {{ .Values.consoleService.nodePort }} {{- else }} - targetPort: {{ .Values.consoleService.port }} + targetPort: {{ .Values.minioConsolePort }} {{- end}} {{- if .Values.consoleService.externalIPs }} externalIPs: diff --git a/helm/minio/templates/networkpolicy.yaml b/helm/minio/templates/networkpolicy.yaml index 68a259957..ac219b937 100644 --- a/helm/minio/templates/networkpolicy.yaml +++ b/helm/minio/templates/networkpolicy.yaml @@ -16,8 +16,8 @@ spec: release: {{ .Release.Name }} ingress: - ports: - - port: {{ .Values.service.port }} - - port: {{ .Values.consoleService.port }} + - port: {{ .Values.minioAPIPort }} + - port: {{ .Values.minioConsolePort }} {{- if not .Values.networkPolicy.allowExternal }} from: - podSelector: diff --git a/helm/minio/templates/service.yaml b/helm/minio/templates/service.yaml index 3daed4163..741528df4 100644 --- a/helm/minio/templates/service.yaml +++ b/helm/minio/templates/service.yaml @@ -36,7 +36,7 @@ spec: {{- if (and (eq .Values.service.type "NodePort") ( .Values.service.nodePort)) }} nodePort: {{ .Values.service.nodePort }} {{- else }} - targetPort: {{ .Values.service.port }} + targetPort: {{ .Values.minioAPIPort }} {{- end}} {{- if .Values.service.externalIPs }} externalIPs: diff --git a/helm/minio/templates/statefulset.yaml b/helm/minio/templates/statefulset.yaml index b4160f0c1..186ab8d09 100644 --- a/helm/minio/templates/statefulset.yaml +++ b/helm/minio/templates/statefulset.yaml @@ -30,6 +30,7 @@ spec: - name: {{ $scheme }} port: {{ .Values.service.port }} protocol: TCP + targetPort: {{ .Values.minioAPIPort }} selector: app: {{ template "minio.name" . }} release: {{ .Release.Name }} diff --git a/helm/minio/values.yaml b/helm/minio/values.yaml index 01989b1c2..e332445f8 100644 --- a/helm/minio/values.yaml +++ b/helm/minio/values.yaml @@ -46,10 +46,12 @@ ignoreChartChecksums: false ## Additional arguments to pass to minio binary extraArgs: [] -## Port number for MinIO S3 API Access +## Internal port number for MinIO S3 API container +## Change service.port to change external port number minioAPIPort: "9000" -## Port number for MinIO Browser COnsole Access +## Internal port number for MinIO Browser Console container +## Change consoleService.port to change external port number minioConsolePort: "9001" ## Update strategy for Deployments @@ -162,7 +164,6 @@ persistence: service: type: ClusterIP clusterIP: ~ - ## Make sure to match it to minioAPIPort port: "9000" nodePort: 32000 @@ -194,7 +195,6 @@ ingress: consoleService: type: ClusterIP clusterIP: ~ - ## Make sure to match it to minioConsolePort port: "9001" nodePort: 32001