Files
charts/bitnami/prometheus-operator/templates/prometheus/service.yaml
2019-10-22 10:50:08 +05:30

34 lines
1.4 KiB
YAML

{{- if .Values.prometheus.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "prometheus-operator.prometheus.fullname" . }}
labels: {{- include "prometheus-operator.prometheus.labels" . | nindent 4 }}
{{- with .Values.prometheus.service.annotations }}
annotations: {{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.prometheus.service.type }}
{{- if and .Values.prometheus.service.loadBalancerIP (eq .Values.prometheus.service.type "LoadBalancer") }}
loadBalancerIP: {{ .Values.prometheus.service.loadBalancerIP }}
{{- end }}
{{- if and (eq .Values.prometheus.service.type "LoadBalancer") .Values.prometheus.service.loadBalancerSourceRanges }}
{{- with .Values.prometheus.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges: {{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- if and (eq .Values.prometheus.service.type "ClusterIP") .Values.prometheus.service.clusterIP }}
clusterIP: {{ .Values.prometheus.service.clusterIP }}
{{- end }}
ports:
- name: http
port: {{ .Values.prometheus.service.port }}
targetPort: 9090
{{- if and .Values.prometheus.service.nodePort (or (eq .Values.prometheus.service.type "NodePort") (eq .Values.prometheus.service.type "LoadBalancer")) }}
nodePort: {{ .Values.prometheus.service.nodePort }}
{{- end }}
selector:
app: prometheus
prometheus: {{ template "prometheus-operator.prometheus.fullname" . }}
{{- end }}