* feat(k8s): added possibility to specify service.type for multiple services in helm chart * fix(k8s): removed headless (clusterIP: None) from services * fix(k8s): keep master and filer services headless for StatefulSet compatibility Master and filer services must remain headless (clusterIP: None) because their StatefulSets reference them via serviceName for stable pod DNS. Revert the service.type change for these two services and remove their unused service config from values.yaml. S3 and SFTP remain configurable. --------- Co-authored-by: Andreas Røste <andreas2101@gmail.com> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> Co-authored-by: Chris Lu <chris.lu@gmail.com>
52 lines
2.0 KiB
YAML
52 lines
2.0 KiB
YAML
{{- if or .Values.s3.enabled .Values.filer.s3.enabled }}
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: {{ include "seaweedfs.componentName" (list . "s3") }}
|
|
namespace: {{ .Release.Namespace }}
|
|
labels:
|
|
app.kubernetes.io/name: {{ template "seaweedfs.name" . }}
|
|
app.kubernetes.io/component: s3
|
|
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
{{- if .Values.s3.annotations }}
|
|
annotations:
|
|
{{- toYaml .Values.s3.annotations | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
type: {{ .Values.s3.service.type }}
|
|
internalTrafficPolicy: {{ .Values.s3.internalTrafficPolicy | default "Cluster" }}
|
|
{{- $td := .Values.s3.trafficDistribution | default .Values.filer.s3.trafficDistribution }}
|
|
{{- if and (semverCompare ">=1.31-0" .Capabilities.KubeVersion.GitVersion) $td }}
|
|
trafficDistribution: {{ include "seaweedfs.trafficDistribution" (dict "value" $td "Capabilities" .Capabilities) }}
|
|
{{- end }}
|
|
ports:
|
|
- name: "swfs-s3"
|
|
port: {{ if .Values.s3.enabled }}{{ .Values.s3.port }}{{ else }}{{ .Values.filer.s3.port }}{{ end }}
|
|
targetPort: {{ if .Values.s3.enabled }}{{ .Values.s3.port }}{{ else }}{{ .Values.filer.s3.port }}{{ end }}
|
|
protocol: TCP
|
|
{{- if and .Values.s3.enabled .Values.s3.icebergPort }}
|
|
- name: "swfs-iceberg"
|
|
port: {{ .Values.s3.icebergPort }}
|
|
targetPort: {{ .Values.s3.icebergPort }}
|
|
protocol: TCP
|
|
{{- end }}
|
|
{{- if and .Values.s3.enabled .Values.s3.httpsPort }}
|
|
- name: "swfs-s3-tls"
|
|
port: {{ .Values.s3.httpsPort }}
|
|
targetPort: {{ .Values.s3.httpsPort }}
|
|
protocol: TCP
|
|
{{- end }}
|
|
{{- if and .Values.s3.enabled .Values.s3.metricsPort }}
|
|
- name: "metrics"
|
|
port: {{ .Values.s3.metricsPort }}
|
|
targetPort: {{ .Values.s3.metricsPort }}
|
|
protocol: TCP
|
|
{{- end }}
|
|
selector:
|
|
app.kubernetes.io/name: {{ template "seaweedfs.name" . }}
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
app.kubernetes.io/component: {{ if .Values.s3.enabled }}s3{{ else }}filer{{ end }}
|
|
{{- end }}
|