apiVersion: v1
kind: ConfigMap
metadata:
  name: kstat-prometheus-configmap
  namespace: kstat-system
data:
  prometheus.yml: |-
    ---
    global:
      scrape_interval: 5s

    scrape_configs:
    - job_name: node-exporter
      #- targets: ["144.126.214.177:9095","144.126.214.226:9095","144.126.222.20:9095"]
      kubernetes_sd_configs:
      - role: endpoints
        namespaces:
          names:
          - kstat-system
      relabel_configs:
      - source_labels:
        - __meta_kubernetes_endpoint_node_name
        action: replace
        target_label: instance
    - job_name: 'kubernetes-cadvisor'
      scheme: https
      metrics_path: /metrics/cadvisor
      kubernetes_sd_configs:
      - role: node
      tls_config:
        ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        insecure_skip_verify: true
      authorization:
        credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token
      relabel_configs:
      - source_labels:
        - __meta_kubernetes_namespace
        target_label: namespace
      - source_labels:
        - __meta_kubernetes_service_name
        target_label: service
      - source_labels:
        - __meta_kubernetes_pod_name
        target_label: pod
      - source_labels:
        - __meta_kubernetes_pod_container_name
        target_label: container
      - source_labels:
        - __meta_kubernetes_service_name
        target_label: job
        replacement: ${1}
      - target_label: endpoint
        replacement: https-metrics
      - source_labels:
        - __metrics_path__
        target_label: metrics_path
