kubezero/charts/kubezero-metrics/charts/kube-prometheus-stack/charts/prometheus-windows-exporter/templates/service.yaml

33 lines
1.1 KiB
YAML

apiVersion: v1
kind: Service
metadata:
name: {{ include "prometheus-windows-exporter.fullname" . }}
namespace: {{ include "prometheus-windows-exporter.namespace" . }}
labels:
{{- include "prometheus-windows-exporter.labels" $ | nindent 4 }}
{{- if or .Values.prometheus.monitor.enabled .Values.prometheus.podMonitor.enabled }}
{{- with .Values.service.annotations }}
annotations:
{{- unset . "prometheus.io/scrape" | toYaml | nindent 4 }}
{{- end }}
{{- else }}
annotations:
prometheus.io/scrape: "true"
{{- with .Values.service.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
{{- if ( and (eq .Values.service.type "NodePort" ) (not (empty .Values.service.nodePort)) ) }}
nodePort: {{ .Values.service.nodePort }}
{{- end }}
targetPort: {{ .Values.service.portName }}
protocol: TCP
appProtocol: http
name: {{ .Values.service.portName }}
selector:
{{- include "prometheus-windows-exporter.selectorLabels" . | nindent 4 }}