Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
apiVersion: v1
kind: Service
metadata:
name: {{ include "adminBackend.serviceName" . }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if or .Values.adminBackend.service.annotations .Values.commonAnnotations}}
annotations:
{{- if .Values.adminBackend.service.annotations }}
{{- include "common.tplvalues.render" (dict "value" .Values.adminBackend.service.annotations "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
{{- end }}
{{- end }}
spec:
type: {{ .Values.adminBackend.service.type }}
{{- if (or (eq .Values.adminBackend.service.type "LoadBalancer") (eq .Values.adminBackend.service.type "NodePort")) }}
externalTrafficPolicy: {{ .Values.adminBackend.service.externalTrafficPolicy | quote }}
{{- end }}
{{- if (and (eq .Values.adminBackend.service.type "LoadBalancer") (not (empty .Values.adminBackend.service.loadBalancerIP))) }}
loadBalancerIP: {{ .Values.adminBackend.service.loadBalancerIP }}
{{- end }}
{{- if (and (eq .Values.adminBackend.service.type "LoadBalancer") .Values.adminBackend.service.loadBalancerSourceRanges) }}
loadBalancerSourceRanges:
{{ toYaml .Values.adminBackend.service.loadBalancerSourceRanges | nindent 4 }}
{{- end }}
ports:
- name: http
port: {{ .Values.adminBackend.service.port }}
targetPort: backend-http
{{- if (and (or (eq .Values.adminBackend.service.type "NodePort") (eq .Values.adminBackend.service.type "LoadBalancer")) (not (empty .Values.adminBackend.service.nodePorts.http))) }}
nodePort: {{ .Values.adminBackend.service.nodePorts.http }}
{{- else if eq .Values.adminBackend.service.type "ClusterIP" }}
nodePort: null
{{- end }}
{{- if .Values.adminBackend.service.extraPorts }}
{{- include "common.tplvalues.render" (dict "value" .Values.adminBackend.service.extraPorts "context" $) | nindent 4 }}
{{- end }}
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}