diff --git a/helm/rustfs/templates/ingress.yaml b/helm/rustfs/templates/ingress.yaml index cc505cfb..bbb7b9d7 100644 --- a/helm/rustfs/templates/ingress.yaml +++ b/helm/rustfs/templates/ingress.yaml @@ -28,12 +28,10 @@ spec: {{- end }} {{- if .Values.ingress.tls.enabled }} tls: - {{- range .Values.ingress.hosts }} - hosts: - {{- range .hosts }} - - {{ . | quote }} + {{- range .Values.ingress.hosts }} + - {{ .host | quote }} {{- end }} - {{- end }} secretName: {{ $secretName }} {{- end }} rules: diff --git a/helm/rustfs/templates/service.yaml b/helm/rustfs/templates/service.yaml index e49894f2..347383ab 100644 --- a/helm/rustfs/templates/service.yaml +++ b/helm/rustfs/templates/service.yaml @@ -13,15 +13,16 @@ spec: clusterIP: None publishNotReadyAddresses: true ports: - - port: {{ .Values.service.ep_port }} - name: endpoint - - port: {{ .Values.service.console_port }} - name: console + - name: endpoint + port: {{ .Values.service.endpoint.port }} + - name: console + port: {{ .Values.service.console.port }} selector: {{- include "rustfs.selectorLabels" . | nindent 4 }} {{- end }} --- +{{- $serviceType := .Values.service.type }} apiVersion: v1 kind: Service metadata: @@ -40,19 +41,27 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: - {{- if .Values.ingress.enabled }} + {{- if eq $serviceType "ClusterIP" }} type: ClusterIP - {{- else }} - type: {{ .Values.service.type }} + {{- else if eq $serviceType "NodePort" }} + type: NodePort sessionAffinity: ClientIP sessionAffinityConfig: clientIP: timeoutSeconds: 10800 {{- end }} ports: - - port: {{ .Values.service.ep_port }} - name: endpoint - - port: {{ .Values.service.console_port }} - name: console + - name: endpoint + port: {{ .Values.service.endpoint.port }} + targetPort: {{ .Values.service.endpoint.port }} + {{- 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: {{- include "rustfs.selectorLabels" . | nindent 4 }} diff --git a/helm/rustfs/values.yaml b/helm/rustfs/values.yaml index 0d78346c..4e669a72 100644 --- a/helm/rustfs/values.yaml +++ b/helm/rustfs/values.yaml @@ -90,9 +90,13 @@ containerSecurityContext: runAsNonRoot: true service: - type: NodePort - ep_port: 9000 - console_port: 9001 + type: ClusterIP + endpoint: + 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/ ingress: