apiVersion: v1       
kind: ConfigMap
metadata:
  name: prometheus-config
  namespace: kube-ops
data:
  prometheus.yml: |
    global: 
      scrape_interval: 15s 
      scrape_timeout: 15s 
    scrape_configs: 
    - job_name: 'prometheus'
      static_configs: 
      - targets: ['localhost:9090']
    - job_name: 'service'
      static_configs: 
      - targets: ['api-service:31110']
      relabel_configs:
      - source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
        action: replace
        regex: ([^:]+)(?::\d+)?;(\d+)
        replacement: $1:$2
        target_label: __address__
      - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path]
        action: replace
        target_label: __metrics_path__
        regex: "(.+)"
    - job_name: 'fail_service'
      static_configs: 
      - targets: ['localhost:11111']
    