add custom nodeport support (#1217)

This commit is contained in:
majinghe
2025-12-20 22:02:21 +08:00
committed by GitHub
parent cc31e88c91
commit 20ea591049
3 changed files with 29 additions and 18 deletions
+2 -4
View File
@@ -28,12 +28,10 @@ spec:
{{- end }} {{- end }}
{{- if .Values.ingress.tls.enabled }} {{- if .Values.ingress.tls.enabled }}
tls: tls:
{{- range .Values.ingress.hosts }}
- hosts: - hosts:
{{- range .hosts }} {{- range .Values.ingress.hosts }}
- {{ . | quote }} - {{ .host | quote }}
{{- end }} {{- end }}
{{- end }}
secretName: {{ $secretName }} secretName: {{ $secretName }}
{{- end }} {{- end }}
rules: rules:
+20 -11
View File
@@ -13,15 +13,16 @@ spec:
clusterIP: None clusterIP: None
publishNotReadyAddresses: true publishNotReadyAddresses: true
ports: ports:
- port: {{ .Values.service.ep_port }} - name: endpoint
name: endpoint port: {{ .Values.service.endpoint.port }}
- port: {{ .Values.service.console_port }} - name: console
name: console port: {{ .Values.service.console.port }}
selector: selector:
{{- include "rustfs.selectorLabels" . | nindent 4 }} {{- include "rustfs.selectorLabels" . | nindent 4 }}
{{- end }} {{- end }}
--- ---
{{- $serviceType := .Values.service.type }}
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
@@ -40,19 +41,27 @@ metadata:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
spec: spec:
{{- if .Values.ingress.enabled }} {{- if eq $serviceType "ClusterIP" }}
type: ClusterIP type: ClusterIP
{{- else }} {{- else if eq $serviceType "NodePort" }}
type: {{ .Values.service.type }} type: NodePort
sessionAffinity: ClientIP sessionAffinity: ClientIP
sessionAffinityConfig: sessionAffinityConfig:
clientIP: clientIP:
timeoutSeconds: 10800 timeoutSeconds: 10800
{{- end }} {{- end }}
ports: ports:
- port: {{ .Values.service.ep_port }} - name: endpoint
name: endpoint port: {{ .Values.service.endpoint.port }}
- port: {{ .Values.service.console_port }} targetPort: {{ .Values.service.endpoint.port }}
name: console {{- if eq $serviceType "NodePort" }}
nodePort: {{ .Values.service.endpoint.nodePort }}
{{- end }}
- name: console
port: {{ .Values.service.console.port }}
targetPort: {{ .Values.service.console.port }}
{{- if eq $serviceType "NodePort" }}
nodePort: {{ .Values.service.console.nodePort }}
{{- end }}
selector: selector:
{{- include "rustfs.selectorLabels" . | nindent 4 }} {{- include "rustfs.selectorLabels" . | nindent 4 }}
+7 -3
View File
@@ -90,9 +90,13 @@ containerSecurityContext:
runAsNonRoot: true runAsNonRoot: true
service: service:
type: NodePort type: ClusterIP
ep_port: 9000 endpoint:
console_port: 9001 port: 9000
nodePort: 32000
console:
port: 9001
nodePort: 32001
# This block is for setting up the ingress for more information can be found here: https://kubernetes.io/docs/concepts/services-networking/ingress/ # This block is for setting up the ingress for more information can be found here: https://kubernetes.io/docs/concepts/services-networking/ingress/
ingress: ingress: