2021-10-04 13:53:13 +02:00
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
2021-10-05 16:39:47 +02:00
|
|
|
name: {{ include "backend.serviceName" . }}
|
2021-10-04 13:53:13 +02:00
|
|
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
|
|
|
{{- if .Values.commonLabels }}
|
|
|
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
|
|
|
{{- end }}
|
2021-10-05 16:39:47 +02:00
|
|
|
{{- if or .Values.backend.service.annotations .Values.commonAnnotations}}
|
2021-10-04 13:53:13 +02:00
|
|
|
annotations:
|
2021-10-05 16:39:47 +02:00
|
|
|
{{- if .Values.backend.service.annotations }}
|
|
|
|
{{- include "common.tplvalues.render" (dict "value" .Values.backend.service.annotations "context" $) | nindent 4 }}
|
2021-10-04 13:53:13 +02:00
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.commonAnnotations }}
|
|
|
|
{{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
spec:
|
2021-10-05 16:39:47 +02:00
|
|
|
type: {{ .Values.backend.service.type }}
|
|
|
|
{{- if (or (eq .Values.backend.service.type "LoadBalancer") (eq .Values.backend.service.type "NodePort")) }}
|
|
|
|
externalTrafficPolicy: {{ .Values.backend.service.externalTrafficPolicy | quote }}
|
2021-10-04 13:53:13 +02:00
|
|
|
{{- end }}
|
2021-10-05 16:39:47 +02:00
|
|
|
{{- if (and (eq .Values.backend.service.type "LoadBalancer") (not (empty .Values.backend.service.loadBalancerIP))) }}
|
|
|
|
loadBalancerIP: {{ .Values.backend.service.loadBalancerIP }}
|
2021-10-04 13:53:13 +02:00
|
|
|
{{- end }}
|
2021-10-05 16:39:47 +02:00
|
|
|
{{- if (and (eq .Values.backend.service.type "LoadBalancer") .Values.backend.service.loadBalancerSourceRanges) }}
|
2021-10-04 13:53:13 +02:00
|
|
|
loadBalancerSourceRanges:
|
2021-10-05 16:39:47 +02:00
|
|
|
{{ toYaml .Values.backend.service.loadBalancerSourceRanges | nindent 4 }}
|
2021-10-04 13:53:13 +02:00
|
|
|
{{- end }}
|
|
|
|
ports:
|
|
|
|
- name: http
|
2021-10-05 16:39:47 +02:00
|
|
|
port: {{ .Values.backend.service.port }}
|
2021-10-04 13:53:13 +02:00
|
|
|
targetPort: backend-http
|
2021-10-05 16:39:47 +02:00
|
|
|
{{- if (and (or (eq .Values.backend.service.type "NodePort") (eq .Values.backend.service.type "LoadBalancer")) (not (empty .Values.backend.service.nodePorts.http))) }}
|
|
|
|
nodePort: {{ .Values.backend.service.nodePorts.http }}
|
|
|
|
{{- else if eq .Values.backend.service.type "ClusterIP" }}
|
2021-10-04 13:53:13 +02:00
|
|
|
nodePort: null
|
|
|
|
{{- end }}
|
2021-10-05 16:39:47 +02:00
|
|
|
{{- if .Values.backend.service.extraPorts }}
|
|
|
|
{{- include "common.tplvalues.render" (dict "value" .Values.backend.service.extraPorts "context" $) | nindent 4 }}
|
2021-10-04 13:53:13 +02:00
|
|
|
{{- end }}
|
|
|
|
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
|