apiVersion: v1
kind: ConfigMap
metadata:
  name: gatus-configs
  namespace: monitoring-system
  labels:
    app.kubernetes.io/name: gatus
data:
  config.yaml: |
    metrics: true
    endpoints:
      - name: firewall
        group: servers
        url: "icmp://192.168.200.1"
        interval: 30s
        conditions:
          - "[CONNECTED] == true"
      - name: k3s-apiserver
        group: servers
        url: "tcp://192.168.200.10:8443"
        interval: 30s
        conditions:
          - "[CONNECTED] == true"
      - name: kmaster1
        group: servers
        url: "icmp://192.168.200.11"
        interval: 30s
        conditions:
          - "[CONNECTED] == true"
      - name: kmaster2
        group: servers
        url: "icmp://192.168.200.12"
        interval: 30s
        conditions:
          - "[CONNECTED] == true"
      - name: kmaster3
        group: servers
        url: "icmp://192.168.200.13"
        interval: 30s
        conditions:
          - "[CONNECTED] == true"
      - name: OMV
        group: servers
        url: "icmp://192.168.200.31"
        interval: 30s
        conditions:
          - "[CONNECTED] == true"
      - name: mariadb
        group: backend-services
        url: "tcp://mariadb.default:3306"
        interval: 30s
        conditions:
          - "[CONNECTED] == true"
      - name: redis
        group: backend-services
        url: "tcp://redis.default:6379"
        interval: 30s
        conditions:
          - "[CONNECTED] == true"
      - name: website
        url: https://budimanjojo.com
        group: frontend-services
        url: "https://${SECRET_DOMAIN_1}"
        interval: 30s
        conditions:
          - "[STATUS] == 200"
        alerts:
          - type: telegram
      - name: homeassistant
        group: frontend-services
        url: "tcp://homeassistant.default:8123"
        interval: 30s
        conditions:
          - "[CONNECTED] == true"
        alerts:
          - type: telegram
      - name: zigbee2mqtt
        group: frontend-services
        url: "tcp://zigbee2mqtt.default:8080"
        interval: 30s
        conditions:
          - "[CONNECTED] == true"
        alerts:
          - type: telegram
      - name: home-dns
        group: frontend-services
        url: 192.168.200.1
        interval: 30s
        dns:
          query-name: "${SECRET_DOMAIN_1}"
          query-type: "A"
        conditions:
          - "[DNS_RCODE] == NOERROR"
          - "[BODY] == 192.168.200.200"
        alerts:
          - type: telegram
    alerting:
      telegram:
        token: ${SECRET_TELEGRAM_TOKEN_0}
        id: ${SECRET_TELEGRAM_CHAT_ID_0}
        default-alert:
          enabled: true
          description: "healthcheck failed"
          send-on-resolved: true
          failure-threshold: 5
          success-threshold: 1
