apiVersion: v1
kind: ConfigMap
metadata:
  name: prometheus-config
data:
  prometheus.yaml: |
    global:
      scrape_interval: 15s
      evaluation_interval: 15s
    scrape_configs:
 
      - job_name: 'k8s_pod'
        kubernetes_sd_configs:
        - role: pod
          namespaces:
            names:
            - <namespace>
        relabel_configs:
          - source_labels: [__meta_kubernetes_pod_label_metrics_prometheus, __meta_kubernetes_pod_container_port_number]
            regex: publish;9090
            action: keep
          - source_labels: [__meta_kubernetes_pod_name]
            action: replace
            target_label: pod_name
          - source_labels: [__meta_kubernetes_namespace]
            action: replace
            target_label: namespace
        scheme: https
        tls_config:
          ca_file: "/etc/ssl/ca.crt"
          cert_file: "/etc/ssl/tls.crt"
          key_file: "/etc/ssl/tls.key"
          insecure_skip_verify: true
