apiVersion: v1
kind: Service
metadata:
  annotations:
    prometheus.io/scrape: 'true'
  labels:
    name: prometheus
  name: prometheus
spec:
  selector:
    app: prometheus
  ports:
  - name: http-prometheus
    protocol: TCP
    port: 9090

{{- if .Values.service.nodePort.enabled }}
# Using separate ingress for nodeport, to avoid conflict with pilot e2e test configs.
---
apiVersion: v1
kind: Service
metadata:
  name: prometheus-nodeport
  labels:
    name: prometheus
spec:
  type: NodePort
  ports:
  - port: 9090
    nodePort: {{ .Values.service.nodePort.port }}
    name: http-prometheus
  selector:
    app: prometheus
{{- end }}
