mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-10 15:16:56 +00:00
8e1fcd4792
Co-authored-by: Helmut Wolf <3902045+shadow1runner@users.noreply.github.com> Co-authored-by: loverustfs <hello@rustfs.com>
70 lines
2.2 KiB
YAML
70 lines
2.2 KiB
YAML
{{- if .Values.mode.distributed.enabled }}
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: {{ include "rustfs.fullname" . }}-headless
|
|
namespace: {{ .Release.Namespace }}
|
|
labels:
|
|
{{- include "rustfs.labels" . | nindent 4 }}
|
|
{{- with .Values.commonLabels }}
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
{{- /* headless service */}}
|
|
clusterIP: None
|
|
publishNotReadyAddresses: true
|
|
ports:
|
|
- 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:
|
|
name: {{ include "rustfs.fullname" . }}-svc
|
|
namespace: {{ .Release.Namespace }}
|
|
{{- if and .Values.mode.distributed.enabled (eq .Values.ingress.className "traefik")}}
|
|
annotations:
|
|
{{- toYaml .Values.ingress.traefikAnnotations | nindent 4 }}
|
|
{{- if and .Values.mtls.enabled (eq .Values.ingress.className "traefik") }}
|
|
traefik.ingress.kubernetes.io/service.serversscheme: https
|
|
traefik.ingress.kubernetes.io/service.serverstransport: {{ .Release.Namespace }}-{{ include "rustfs.fullname" . }}-transport@kubernetescrd
|
|
{{- end }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "rustfs.labels" . | nindent 4 }}
|
|
{{- with .Values.commonLabels }}
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
{{- if eq $serviceType "ClusterIP" }}
|
|
type: ClusterIP
|
|
{{- else if eq $serviceType "NodePort" }}
|
|
type: NodePort
|
|
sessionAffinity: ClientIP
|
|
sessionAffinityConfig:
|
|
clientIP:
|
|
timeoutSeconds: 10800
|
|
{{- end }}
|
|
ports:
|
|
- 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 }}
|