apiVersion: v1 kind: Service metadata: name: {{ include "adminFrontend.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.adminFrontend.service.annotations .Values.commonAnnotations}} annotations: {{- if .Values.adminFrontend.service.annotations }} {{- include "common.tplvalues.render" (dict "value" .Values.adminFrontend.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.adminFrontend.service.type }} {{- if (or (eq .Values.adminFrontend.service.type "LoadBalancer") (eq .Values.adminFrontend.service.type "NodePort")) }} externalTrafficPolicy: {{ .Values.adminFrontend.service.externalTrafficPolicy | quote }} {{- end }} {{- if (and (eq .Values.adminFrontend.service.type "LoadBalancer") (not (empty .Values.adminFrontend.service.loadBalancerIP))) }} loadBalancerIP: {{ .Values.adminFrontend.service.loadBalancerIP }} {{- end }} {{- if (and (eq .Values.adminFrontend.service.type "LoadBalancer") .Values.adminFrontend.service.loadBalancerSourceRanges) }} loadBalancerSourceRanges: {{ toYaml .Values.adminFrontend.service.loadBalancerSourceRanges | nindent 4 }} {{- end }} ports: - name: http port: {{ .Values.adminFrontend.service.port }} targetPort: frontend-http {{- if (and (or (eq .Values.adminFrontend.service.type "NodePort") (eq .Values.adminFrontend.service.type "LoadBalancer")) (not (empty .Values.adminFrontend.service.nodePorts.http))) }} nodePort: {{ .Values.adminFrontend.service.nodePorts.http }} {{- else if eq .Values.adminFrontend.service.type "ClusterIP" }} nodePort: null {{- end }} {{- if .Values.adminFrontend.service.extraPorts }} {{- include "common.tplvalues.render" (dict "value" .Values.adminFrontend.service.extraPorts "context" $) | nindent 4 }} {{- end }} selector: {{- include "common.labels.matchLabels" . | nindent 4 }}