Newer
Older
apiVersion: v1
kind: Service
metadata:

Maarten de Waard
committed
name: {{ include "backend.serviceName" . }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}

Maarten de Waard
committed
{{- if or .Values.backend.service.annotations .Values.commonAnnotations}}

Maarten de Waard
committed
{{- if .Values.backend.service.annotations }}
{{- include "common.tplvalues.render" (dict "value" .Values.backend.service.annotations "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
{{- end }}
{{- end }}
spec:

Maarten de Waard
committed
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 }}

Maarten de Waard
committed
{{- if (and (eq .Values.backend.service.type "LoadBalancer") (not (empty .Values.backend.service.loadBalancerIP))) }}
loadBalancerIP: {{ .Values.backend.service.loadBalancerIP }}

Maarten de Waard
committed
{{- if (and (eq .Values.backend.service.type "LoadBalancer") .Values.backend.service.loadBalancerSourceRanges) }}

Maarten de Waard
committed
{{ toYaml .Values.backend.service.loadBalancerSourceRanges | nindent 4 }}

Maarten de Waard
committed
port: {{ .Values.backend.service.port }}

Maarten de Waard
committed
{{- 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" }}

Maarten de Waard
committed
{{- if .Values.backend.service.extraPorts }}
{{- include "common.tplvalues.render" (dict "value" .Values.backend.service.extraPorts "context" $) | nindent 4 }}
{{- end }}
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}