41 lines
1.2 KiB
YAML
41 lines
1.2 KiB
YAML
{{- if eq (include "mimir.gateway.isEnabled" .) "true" -}}
|
|
{{- with .Values.gateway -}}
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: {{ include "mimir.gateway.service.name" $ }}
|
|
labels:
|
|
{{- include "mimir.labels" (dict "ctx" $ "component" "gateway") | nindent 4 }}
|
|
{{- with .service.labels }}
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
annotations:
|
|
{{- toYaml .service.annotations | nindent 4 }}
|
|
namespace: {{ $.Release.Namespace | quote }}
|
|
spec:
|
|
type: {{ .service.type }}
|
|
{{- with .service.clusterIP }}
|
|
clusterIP: {{ . }}
|
|
{{- end }}
|
|
{{- if and (eq "LoadBalancer" .service.type) .service.loadBalancerIP }}
|
|
loadBalancerIP: {{ .service.loadBalancerIP }}
|
|
{{- end }}
|
|
ports:
|
|
- port: {{ .service.port }}
|
|
protocol: TCP
|
|
name: http-metrics
|
|
targetPort: http-metrics
|
|
{{- if and (eq "NodePort" .service.type) .service.nodePort }}
|
|
nodePort: {{ .service.nodePort }}
|
|
{{- end }}
|
|
{{- with .service.legacyPort }}
|
|
- port: {{ . }}
|
|
protocol: TCP
|
|
name: legacy-http-metrics
|
|
targetPort: http-metrics
|
|
{{- end }}
|
|
selector:
|
|
{{- include "mimir.selectorLabels" (dict "ctx" $ "component" "gateway") | nindent 4 }}
|
|
{{- end -}}
|
|
{{- end -}}
|