{{ range .Values.robots }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: prometheus-federation-{{ .name }}
  labels:
    prometheus: kube-prometheus
spec:
  endpoints:
  - port: http
    path: /client/{{ .name }}/federate
    params:
      'match[]':
      - '{job=~".+"}'
    honorLabels: true
  targetLabels:
  - robot
  selector:
    matchLabels:
      app: prometheus-federation
      robot: "{{ .name }}"
---
apiVersion: v1
kind: Service
metadata:
  name: prometheus-federation-{{ .name }}
  labels:
    app: prometheus-federation
    robot: "{{ .name }}"
spec:
  ports:
  - port: 80
    targetPort: 80
    protocol: TCP
    name: http
  selector:
    app: prometheus-relay-server
  type: ClusterIP
---
{{ end }}

{{ range .Values.robots }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: prometheus-federation-{{ .name }}
  labels:
    prometheus: kube-prometheus
spec:
  endpoints:
  - port: http
    path: /client/{{ .name }}/federate
    params:
      'match[]':
      - '{job=~".+"}'
    honorLabels: true
  targetLabels:
  - robot
  selector:
    matchLabels:
      app: prometheus-federation
      robot: "{{ .name }}"
---
apiVersion: v1
kind: Service
metadata:
  name: prometheus-federation-{{ .name }}
  labels:
    app: prometheus-federation
    robot: "{{ .name }}"
spec:
  ports:
  - port: 80
    targetPort: 8080
    protocol: TCP
    name: http
  selector:
    app: prometheus-relay-server
  type: ClusterIP
---
{{ end }}

Fix federation after moving services from 80 to 8080
Fix federation after moving services from 80 to 8080

Fixes b/177216437

Change-Id: I849502b4f74206797b98f7ce8baf25e427efde5c
GitOrigin-RevId: 5d4e0ddb6845a6fd51b9edb02846915d11f86ac3
