apiVersion: apps/v1
kind: Deployment
metadata:
  name: k6-prometheus-exporter
spec:
  selector:
    matchLabels:
      app: k6-exporter
  template:
    metadata:
      labels:
        app: k6-exporter
      annotations:
        prometheus.io/port: '2112'
        prometheus.io/scrape: 'true'
    spec:
      containers:
        - name: k6-exporter
          image: ghcr.io/benc-uk/k6-prometheus-exporter:latest
          imagePullPolicy: Always
          env:
            - name: 'K6_API_ENDPOINT'
              # Note name much match the service name in k6-loadtest.yaml
              value: 'http://load-test:6565/v1'
          ports:
            - containerPort: 2112
