Browse Source
helm: add a trafficDistribution field to an s3 service (#8232)
helm: add trafficDistribution field to s3 service
Signed-off-by: nbykov0 <166552198+nbykov0@users.noreply.github.com>
pull/8233/head^2
Nikita
2 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
12 additions and
0 deletions
-
k8s/charts/seaweedfs/templates/s3/s3-service.yaml
-
k8s/charts/seaweedfs/templates/shared/_helpers.tpl
|
|
@ -16,6 +16,9 @@ metadata: |
|
|
{{- end }} |
|
|
{{- end }} |
|
|
spec: |
|
|
spec: |
|
|
internalTrafficPolicy: {{ .Values.s3.internalTrafficPolicy | default "Cluster" }} |
|
|
internalTrafficPolicy: {{ .Values.s3.internalTrafficPolicy | default "Cluster" }} |
|
|
|
|
|
{{- if and (semverCompare ">=1.31-0" .Capabilities.KubeVersion.GitVersion) (or .Values.s3.trafficDistribution .Values.filer.s3.trafficDistribution) }} |
|
|
|
|
|
trafficDistribution: {{ include "seaweedfs.trafficDistribution" . }} |
|
|
|
|
|
{{- end }} |
|
|
ports: |
|
|
ports: |
|
|
- name: "swfs-s3" |
|
|
- name: "swfs-s3" |
|
|
port: {{ if .Values.s3.enabled }}{{ .Values.s3.port }}{{ else }}{{ .Values.filer.s3.port }}{{ end }} |
|
|
port: {{ if .Values.s3.enabled }}{{ .Values.s3.port }}{{ else }}{{ .Values.filer.s3.port }}{{ end }} |
|
|
|
|
|
@ -323,3 +323,12 @@ Create the name of the service account to use |
|
|
{{- define "seaweedfs.serviceAccountName" -}} |
|
|
{{- define "seaweedfs.serviceAccountName" -}} |
|
|
{{- .Values.global.serviceAccountName | default "seaweedfs" -}} |
|
|
{{- .Values.global.serviceAccountName | default "seaweedfs" -}} |
|
|
{{- end -}} |
|
|
{{- end -}} |
|
|
|
|
|
|
|
|
|
|
|
{{/* Generate a compatible trafficDistribution value due to "PreferClose" fast deprecation in k8s v1.35 */}} |
|
|
|
|
|
{{- define "seaweedfs.trafficDistribution" -}} |
|
|
|
|
|
{{- if .Values.s3.trafficDistribution -}} |
|
|
|
|
|
{{- and (eq .Values.s3.trafficDistribution "PreferClose") (semverCompare ">=1.35-0" .Capabilities.KubeVersion.GitVersion) | ternary "PreferSameZone" .Values.s3.trafficDistribution -}} |
|
|
|
|
|
{{- else if .Values.filer.s3.trafficDistribution -}} |
|
|
|
|
|
{{- and (eq .Values.filer.s3.trafficDistribution "PreferClose") (semverCompare ">=1.35-0" .Capabilities.KubeVersion.GitVersion) | ternary "PreferSameZone" .Values.filer.s3.trafficDistribution -}} |
|
|
|
|
|
{{- end -}} |
|
|
|
|
|
{{- end -}} |