#
# IMPORTANT NOTE
#
# This chart inherits from our common library chart. You can check the default values/options here:
# https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common/values.yaml
#

image:
  # -- image repository
  repository: ghcr.io/miguelndecarvalho/speedtest-exporter
  # -- image tag
  tag: v3.2.2
  # -- image pull policy
  pullPolicy: IfNotPresent

# -- environment variables. See [application docs](https://docs.miguelndecarvalho.pt/projects/speedtest-exporter/) for more details.
# @default -- See below
env:
  # -- Set the container timezone
  TZ: UTC

# -- Configures service settings for the chart.
# @default -- See values.yaml
service:
  main:
    ports:
      http:
        enabled: false
      metrics:
        enabled: true
        protocol: TCP
        port: 9798

metrics:
  # -- Enable and configure a Prometheus serviceMonitor for the chart under this key.
  # @default -- See values.yaml
  enabled: false
  serviceMonitor:
    # -- The interval field must use minutes for the padding to calculate properly.
    interval: 60m
    scrapeTimeout: 1m
    labels: {}
  # -- Enable and configure Prometheus Rules for the chart under this key.
  # @default -- See values.yaml
  prometheusRule:
    enabled: false
    # -- Download speed you want alerts to be triggered in Mbps
    downloadLimit: 400
    # -- Upload speed you want alerts to be triggered in Mbps
    uploadLimit: 400
    # -- Ping latency you want alerts to be triggered in ms
    pingLimit: 10
    # -- Jitter latency you want alerts to be triggered in ms
    jitterLimit: 30
    labels: {}
    # -- Configure additionial rules for the chart under this key.
    # @default -- See prometheusrules.yaml
    rules: []
      # - alert: SpeedtestSlowInternetDownload
      #   annotations:
      #     description: Internet download speed is averaging {{ "{{ humanize $value }}" }} Mbps.
      #     summary: SpeedTest slow internet download.
      #   expr: |
      #     avg_over_time(speedtest_download_bits_per_second{job=~".*{{ include "common.names.fullname" . }}.*"}[4h])
      #       < {{ .Values.metrics.prometheusRule.downloadLimit }}
      #   for: 0m
      #   labels:
      #     severity: warning
