mirror of https://git.rancher.io/charts
56 lines
2.0 KiB
YAML
56 lines
2.0 KiB
YAML
{{- if .Values.prometheusOperator.enabled }}
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: {{ template "kube-prometheus-stack.fullname" . }}-operator
|
|
namespace: {{ template "kube-prometheus-stack.namespace" . }}
|
|
labels:
|
|
app: {{ template "kube-prometheus-stack.name" . }}-operator
|
|
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
|
|
{{- if .Values.prometheusOperator.service.labels }}
|
|
{{ toYaml .Values.prometheusOperator.service.labels | indent 4 }}
|
|
{{- end }}
|
|
{{- if .Values.prometheusOperator.service.annotations }}
|
|
annotations:
|
|
{{ toYaml .Values.prometheusOperator.service.annotations | indent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
{{- if .Values.prometheusOperator.service.clusterIP }}
|
|
clusterIP: {{ .Values.prometheusOperator.service.clusterIP }}
|
|
{{- end }}
|
|
{{- if .Values.prometheusOperator.service.externalIPs }}
|
|
externalIPs:
|
|
{{ toYaml .Values.prometheusOperator.service.externalIPs | indent 4 }}
|
|
{{- end }}
|
|
{{- if .Values.prometheusOperator.service.loadBalancerIP }}
|
|
loadBalancerIP: {{ .Values.prometheusOperator.service.loadBalancerIP }}
|
|
{{- end }}
|
|
{{- if .Values.prometheusOperator.service.loadBalancerSourceRanges }}
|
|
loadBalancerSourceRanges:
|
|
{{- range $cidr := .Values.prometheusOperator.service.loadBalancerSourceRanges }}
|
|
- {{ $cidr }}
|
|
{{- end }}
|
|
{{- end }}
|
|
ports:
|
|
{{- if not .Values.prometheusOperator.tls.enabled }}
|
|
- name: http
|
|
{{- if eq .Values.prometheusOperator.service.type "NodePort" }}
|
|
nodePort: {{ .Values.prometheusOperator.service.nodePort }}
|
|
{{- end }}
|
|
port: 8080
|
|
targetPort: http
|
|
{{- end }}
|
|
{{- if .Values.prometheusOperator.tls.enabled }}
|
|
- name: https
|
|
{{- if eq .Values.prometheusOperator.service.type "NodePort"}}
|
|
nodePort: {{ .Values.prometheusOperator.service.nodePortTls }}
|
|
{{- end }}
|
|
port: 443
|
|
targetPort: https
|
|
{{- end }}
|
|
selector:
|
|
app: {{ template "kube-prometheus-stack.name" . }}-operator
|
|
release: {{ $.Release.Name | quote }}
|
|
type: "{{ .Values.prometheusOperator.service.type }}"
|
|
{{- end }}
|