apiVersion: v1
kind: ConfigMap
metadata:
  namespace: monitoring
  name: prometheus
  labels:
    app: prometheus
data:
  prometheus.yml: |-

    global:
      scrape_interval: 10s
      scrape_timeout: 5s

    scrape_configs:
      - job_name: node-exporter
        kubernetes_sd_configs:
          - role: node
        relabel_configs:
          - source_labels: [__address__]
            regex: (.*):(\d+)
            target_label: __address__
            replacement: ${1}:9100
      - job_name: kubelet
        kubernetes_sd_configs:
          - role: node
        relabel_configs:
          - source_labels: [__address__]
            regex: (.*):(\d+)
            target_label: __address__
            replacement: ${1}:10255
      - job_name: cadvisor
        metrics_path: /metrics/cadvisor
        kubernetes_sd_configs:
          - role: node
        relabel_configs:
          - source_labels: [__address__]
            regex: (.*):(\d+)
            target_label: __address__
            replacement: ${1}:10255
      - job_name: kube-state-metrics
        static_configs:
          - targets:
            - kube-state-metrics:8080
            - kube-state-metrics:8081
      # - job_name: my-apps
      #   metrics_path: /actuator/prometheus
      #   static_configs:
      #     - targets:
      #       - my-app.default.svc:8080
   