Browse Source

helm: Support multiple hosts for S3 ingress (#7931)

master
Sheya Bernstein 8 hours ago
committed by GitHub
parent
commit
6f28cb7f87
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 28
      k8s/charts/seaweedfs/templates/s3/s3-ingress.yaml
  2. 2
      k8s/charts/seaweedfs/values.yaml

28
k8s/charts/seaweedfs/templates/s3/s3-ingress.yaml

@ -4,6 +4,13 @@
{{- /* Determine service name based on deployment mode */}}
{{- $serviceName := ternary (printf "%s-all-in-one" (include "seaweedfs.name" .)) (printf "%s-s3" (include "seaweedfs.name" .)) .Values.allInOne.enabled }}
{{- $s3Port := .Values.allInOne.s3.port | default .Values.s3.port }}
{{- /* Build hosts list - support both legacy .host (string) and new .hosts (array) for backwards compatibility */}}
{{- $hosts := list }}
{{- if kindIs "slice" .Values.s3.ingress.host }}
{{- $hosts = .Values.s3.ingress.host }}
{{- else if .Values.s3.ingress.host }}
{{- $hosts = list .Values.s3.ingress.host }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion }}
@ -30,6 +37,25 @@ spec:
tls:
{{ .Values.s3.ingress.tls | default list | toYaml | nindent 6}}
rules:
{{- if $hosts }}
{{- range $hosts }}
- host: {{ . | quote }}
http:
paths:
- path: {{ $.Values.s3.ingress.path | quote }}
pathType: {{ $.Values.s3.ingress.pathType | quote }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $serviceName }}
port:
number: {{ $s3Port }}
{{- else }}
serviceName: {{ $serviceName }}
servicePort: {{ $s3Port }}
{{- end }}
{{- end }}
{{- else }}
- http:
paths:
- path: {{ .Values.s3.ingress.path | quote }}
@ -44,7 +70,5 @@ spec:
serviceName: {{ $serviceName }}
servicePort: {{ $s3Port }}
{{- end }}
{{- if .Values.s3.ingress.host }}
host: {{ .Values.s3.ingress.host | quote }}
{{- end }}
{{- end }}

2
k8s/charts/seaweedfs/values.yaml

@ -1012,7 +1012,7 @@ s3:
ingress:
enabled: false
className: ""
# host: false for "*" hostname
# host: false for "*" hostname, or an array for multiple hostnames
host: "seaweedfs.cluster.local"
path: "/"
pathType: Prefix

Loading…
Cancel
Save