dashboard/deployment/helmchart/templates/frontend-service.yaml

43 lines
2.1 KiB
YAML
Raw Normal View History

2021-10-04 13:53:13 +02:00
apiVersion: v1
kind: Service
metadata:
2021-11-22 15:43:51 +01:00
name: {{ include "dashboard.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-11-22 15:43:51 +01:00
{{- if or .Values.dashboard.service.annotations .Values.commonAnnotations}}
2021-10-04 13:53:13 +02:00
annotations:
2021-11-22 15:43:51 +01:00
{{- if .Values.dashboard.service.annotations }}
{{- include "common.tplvalues.render" (dict "value" .Values.dashboard.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-11-22 15:43:51 +01:00
type: {{ .Values.dashboard.service.type }}
{{- if (or (eq .Values.dashboard.service.type "LoadBalancer") (eq .Values.dashboard.service.type "NodePort")) }}
externalTrafficPolicy: {{ .Values.dashboard.service.externalTrafficPolicy | quote }}
2021-10-04 13:53:13 +02:00
{{- end }}
2021-11-22 15:43:51 +01:00
{{- if (and (eq .Values.dashboard.service.type "LoadBalancer") (not (empty .Values.dashboard.service.loadBalancerIP))) }}
loadBalancerIP: {{ .Values.dashboard.service.loadBalancerIP }}
2021-10-04 13:53:13 +02:00
{{- end }}
2021-11-22 15:43:51 +01:00
{{- if (and (eq .Values.dashboard.service.type "LoadBalancer") .Values.dashboard.service.loadBalancerSourceRanges) }}
2021-10-04 13:53:13 +02:00
loadBalancerSourceRanges:
2021-11-22 15:43:51 +01:00
{{ toYaml .Values.dashboard.service.loadBalancerSourceRanges | nindent 4 }}
2021-10-04 13:53:13 +02:00
{{- end }}
ports:
- name: http
2021-11-22 15:43:51 +01:00
port: {{ .Values.dashboard.service.port }}
targetPort: dashboard-http
{{- if (and (or (eq .Values.dashboard.service.type "NodePort") (eq .Values.dashboard.service.type "LoadBalancer")) (not (empty .Values.dashboard.service.nodePorts.http))) }}
nodePort: {{ .Values.dashboard.service.nodePorts.http }}
{{- else if eq .Values.dashboard.service.type "ClusterIP" }}
2021-10-04 13:53:13 +02:00
nodePort: null
{{- end }}
2021-11-22 15:43:51 +01:00
{{- if .Values.dashboard.service.extraPorts }}
{{- include "common.tplvalues.render" (dict "value" .Values.dashboard.service.extraPorts "context" $) | nindent 4 }}
2021-10-04 13:53:13 +02:00
{{- end }}
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}