blob: 8c710263d7d2b235e480d5f9c47930af8272b040 [file] [log] [blame]
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +00001{{- if .Values.gateway.enabled }}
2apiVersion: v1
3kind: Service
4metadata:
5 name: {{ include "loki.gatewayFullname" . }}
Giovanni Tirloni59219b62024-04-09 14:50:25 -03006 namespace: {{ $.Release.Namespace }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +00007 labels:
8 {{- include "loki.gatewayLabels" . | nindent 4 }}
Giovanni Tirloni59219b62024-04-09 14:50:25 -03009 {{- with .Values.loki.serviceLabels }}
10 {{- toYaml . | nindent 4}}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000011 {{- end }}
Giovanni Tirloni59219b62024-04-09 14:50:25 -030012 {{- with .Values.gateway.service.labels }}
13 {{- toYaml . | nindent 4}}
14 {{- end }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000015 annotations:
Giovanni Tirloni59219b62024-04-09 14:50:25 -030016 {{- with .Values.loki.serviceAnnotations }}
17 {{- toYaml . | nindent 4}}
18 {{- end }}
19 {{- with .Values.gateway.service.annotations }}
20 {{- toYaml . | nindent 4}}
21 {{- end }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000022spec:
23 type: {{ .Values.gateway.service.type }}
24 {{- with .Values.gateway.service.clusterIP }}
25 clusterIP: {{ . }}
26 {{- end }}
27 {{- if and (eq "LoadBalancer" .Values.gateway.service.type) .Values.gateway.service.loadBalancerIP }}
28 loadBalancerIP: {{ .Values.gateway.service.loadBalancerIP }}
29 {{- end }}
30 ports:
Mohammed Naser65cda132024-05-02 14:34:08 -040031 - name: http-metrics
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000032 port: {{ .Values.gateway.service.port }}
Mohammed Naser65cda132024-05-02 14:34:08 -040033 targetPort: http-metrics
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000034 {{- if and (eq "NodePort" .Values.gateway.service.type) .Values.gateway.service.nodePort }}
35 nodePort: {{ .Values.gateway.service.nodePort }}
36 {{- end }}
37 protocol: TCP
38 selector:
39 {{- include "loki.gatewaySelectorLabels" . | nindent 4 }}
40{{- end }}