-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
Copy pathservice-gateway.yaml
43 lines (43 loc) · 1.31 KB
/
service-gateway.yaml
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
43
{{- if .Values.gateway.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "loki.gatewayFullname" . }}
labels:
{{- include "loki.gatewayLabels" . | nindent 4 }}
{{- include "loki.commonLabels" . | nindent 4 }}
{{- with .Values.gateway.service.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.gateway.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.gateway.service.type }}
{{- with .Values.gateway.service.clusterIP }}
clusterIP: {{ . }}
{{- end }}
{{- if eq "LoadBalancer" .Values.gateway.service.type }}
{{- with .Values.gateway.service.loadBalancerIP }}
loadBalancerIP: {{ . }}
{{- end }}
{{- with .Values.gateway.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
ports:
- name: http
port: {{ .Values.gateway.service.port }}
targetPort: http
{{- if and (eq "NodePort" .Values.gateway.service.type) .Values.gateway.service.nodePort }}
nodePort: {{ .Values.gateway.service.nodePort }}
{{- end }}
protocol: TCP
{{- with .Values.gateway.service.appProtocol }}
appProtocol: {{ . }}
{{- end }}
selector:
{{- include "loki.gatewaySelectorLabels" . | nindent 4 }}
{{- end }}