# Based on: https://www.digitalocean.com/community/tutorials/how-to-set-up-digitalocean-kubernetes-cluster-monitoring-with-helm-and-prometheus-operator
apiVersion: v1
kind: ConfigMap
metadata:
  name: prometheus-config
  namespace: monitoring
data:
  values.yaml: |
    prometheus:
      prometheusSpec:
        ruleSelector: {}
        ruleSelectorNilUsesHelmValues: false
        serviceMonitorSelectorNilUsesHelmValues: false
        storageSpec:
          volumeClaimTemplate:
            spec:
              accessModes: ["ReadWriteOnce"]
              storageClassName: do-block-storage
              resources:
                requests:
                  storage: 25Gi

    grafana:
      adminPassword: poleax-lay-levitate
      persistence:
        enabled: true
        storageClassName: do-block-storage
        accessModes: ["ReadWriteOnce"]
        size: 5Gi

    alertmanager:
      alertmanagerSpec:
        storage:
          volumeClaimTemplate:
            spec:
              accessModes: ["ReadWriteOnce"]
              storageClassName: do-block-storage
              resources:
                requests:
                  storage: 5Gi
      config:
        global:
          slack_api_url: "" # SET ENDPOINT FOR ALERTS
        route:
          group_by: ["alertname", "cluster", "service"]
          receiver: 'null'
          routes:
            - receiver: discord-alerts
              match:
                severity: 'critical'
            - receiver: 'null'
              match:
                alertname: Watchdog
        receivers:
          - name: 'null'
          - name: discord-alerts
            slack_configs:
              - send_resolved: true

    prometheus-node-exporter:
      service:
        port: 30206
        targetPort: 30206

    kubeEtcd:
      enabled: false

    kubeControllerManager:
      enabled: false

    kubeScheduler:
      enabled: false
