kind: ConfigMap
apiVersion: v1
metadata:
  name: prometheus-config
data:
  prometheus.yml: |-
    global:
      scrape_interval: 15s
      evaluation_interval: 15s
      external_labels:
        cluster: custom
    scrape_configs:
    - job_name: 'metrics-test'
      kubernetes_sd_configs:
        - role: pod
      tls_config:
        ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
      bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
      relabel_configs:
      - source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_name]
        regex: metrics
        action: keep
      - source_labels: [__meta_kubernetes_pod_ip]
        action: replace
        regex: (.*)
        replacement: ${1}:9091
        target_label: __address__
      - source_labels:
        - __meta_kubernetes_pod_name
        target_label: pod

