apiVersion: v1
kind: ConfigMap
metadata:
  name: cluster-monitoring-config
  namespace: openshift-monitoring
data:
  config.yaml: |
    enableUserWorkload: true 
    prometheusK8s:
    # If the location of this config changes,
    # make sure to adjust https://github.com/openshift/ops-sop/blob/master/v4/howto/o11m_mst_killswitch.md
    # so that killswitch instructions point to the right file!
      remoteWrite:
        - url: http://token-refresher.openshift-monitoring.svc.cluster.local
          remoteTimeout: 30s
          writeRelabelConfigs:
          - sourceLabels: [__name__]
            action: keep
            regex: '(cluster_admin_enabled|identity_provider|probe_success|probe_duration_seconds)'
          queueConfig:
            capacity: 2500
            maxShards: 1000
            minShards: 1
            maxSamplesPerSend: 500
            batchSendDeadline: 60s
            minBackoff: 30ms
            maxBackoff: 100ms
      nodeSelector:
        node-role.kubernetes.io/infra: ""
      tolerations:
        - effect: NoSchedule
          key: node-role.kubernetes.io/infra
          operator: Exists
      retention: 11d
      volumeClaimTemplate:
        metadata:
          name: prometheus-data
        spec:
          resources:
            requests:
              storage: 100Gi
    alertmanagerMain:
      nodeSelector:
        node-role.kubernetes.io/infra: ""
      tolerations:
        - effect: NoSchedule
          key: node-role.kubernetes.io/infra
          operator: Exists
      volumeClaimTemplate:
        metadata:
          name: alertmanager-data
        spec:
          resources:
            requests:
              storage: 10Gi
    telemeterClient:
      nodeSelector:
        node-role.kubernetes.io/infra: ""
      tolerations:
        - effect: NoSchedule
          key: node-role.kubernetes.io/infra
          operator: Exists
      telemeterServerURL: ${TELEMETER_SERVER_URL}
    prometheusOperator:
      nodeSelector:
        node-role.kubernetes.io/infra: ""
      tolerations:
        - effect: NoSchedule
          key: node-role.kubernetes.io/infra
          operator: Exists
    grafana:
      nodeSelector:
        node-role.kubernetes.io/infra: ""
      tolerations:
        - effect: NoSchedule
          key: node-role.kubernetes.io/infra
          operator: Exists
    k8sPrometheusAdapter:
      nodeSelector:
        node-role.kubernetes.io/infra: ""
      tolerations:
        - effect: NoSchedule
          key: node-role.kubernetes.io/infra
          operator: Exists
    kubeStateMetrics:
      nodeSelector:
        node-role.kubernetes.io/infra: ""
      tolerations:
        - effect: NoSchedule
          key: node-role.kubernetes.io/infra
          operator: Exists
    openshiftStateMetrics:
      nodeSelector:
        node-role.kubernetes.io/infra: ""
      tolerations:
        - effect: NoSchedule
          key: node-role.kubernetes.io/infra
          operator: Exists
    # https://access.redhat.com/solutions/5685771
    # https://bugzilla.redhat.com/show_bug.cgi?id=1906496
    thanosQuerier:
      resources:
        limits:
          cpu: 500m
          memory: 2048Mi
        requests:
          cpu: 5m
          memory: 125Mi
