Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 1 | {{- if .Values.gateway.enabled }} |
| 2 | apiVersion: v1 |
| 3 | kind: Service |
| 4 | metadata: |
| 5 | name: {{ include "loki.gatewayFullname" . }} |
Giovanni Tirloni | 59219b6 | 2024-04-09 14:50:25 -0300 | [diff] [blame] | 6 | namespace: {{ $.Release.Namespace }} |
Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 7 | labels: |
| 8 | {{- include "loki.gatewayLabels" . | nindent 4 }} |
Giovanni Tirloni | 59219b6 | 2024-04-09 14:50:25 -0300 | [diff] [blame] | 9 | {{- with .Values.loki.serviceLabels }} |
| 10 | {{- toYaml . | nindent 4}} |
Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 11 | {{- end }} |
Giovanni Tirloni | 59219b6 | 2024-04-09 14:50:25 -0300 | [diff] [blame] | 12 | {{- with .Values.gateway.service.labels }} |
| 13 | {{- toYaml . | nindent 4}} |
| 14 | {{- end }} |
Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 15 | annotations: |
Giovanni Tirloni | 59219b6 | 2024-04-09 14:50:25 -0300 | [diff] [blame] | 16 | {{- with .Values.loki.serviceAnnotations }} |
| 17 | {{- toYaml . | nindent 4}} |
| 18 | {{- end }} |
| 19 | {{- with .Values.gateway.service.annotations }} |
| 20 | {{- toYaml . | nindent 4}} |
| 21 | {{- end }} |
Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 22 | spec: |
| 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 Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame] | 31 | - name: http-metrics |
Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 32 | port: {{ .Values.gateway.service.port }} |
Mohammed Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame] | 33 | targetPort: http-metrics |
Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 34 | {{- 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 }} |