#
# 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/akpw/mktxp
  # -- image tag
  # @default -- chart.appVersion
  tag: latest
  # -- image pull policy
  pullPolicy: IfNotPresent

# -- environment variables. See more environment variables in the [cyberchef documentation](https://cyberchef.org/docs).
# @default -- See below
env:
  # -- Set the container timezone
  TZ: UTC

# -- Configures service settings for the chart.
# @default -- See values.yaml
service:
  main:
    ports:
      http:
        port: 49090

ingress:
  main:
    enabled: false
# -- Configure persistence settings for the chart under this key. (none required
# for this chart)
# @default -- See values.yaml
persistence: {}
  # data:
  #   enabled: false
  #   mountPath: /data

configmap:
  config:
    enabled: true
    data:
      mktxp.conf: |
        ## Copyright (c) 2020 Arseniy Kuznetsov
        ##
        ## This program is free software; you can redistribute it and/or
        ## modify it under the terms of the GNU General Public License
        ## as published by the Free Software Foundation; either version 2
        ## of the License, or (at your option) any later version.
        ##
        ## This program is distributed in the hope that it will be useful,
        ## but WITHOUT ANY WARRANTY; without even the implied warranty of
        ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        ## GNU General Public License for more details.


        [Sample-Router]
            enabled = False         # turns metrics collection for this RouterOS device on / off

            hostname = localhost    # RouterOS IP address
            port = 8728             # RouterOS IP Port

            username = username     # RouterOS user, needs to have 'read' and 'api' permissions
            password = password

            use_ssl = False                 # enables connection via API-SSL servis
            no_ssl_certificate = False      # enables API_SSL connect without router SSL certificate
            ssl_certificate_verify = False  # turns SSL certificate verification on / off

            installed_packages = True       # Installed packages
            dhcp = True                     # DHCP general metrics
            dhcp_lease = True               # DHCP lease metrics

            connections = True              # IP connections metrics
            connection_stats = False        # Open IP connections metrics

            pool = True                     # Pool metrics
            interface = True                # Interfaces traffic metrics

            firewall = True                 # IPv4 Firewall rules traffic metrics
            ipv6_firewall = False           # IPv6 Firewall rules traffic metrics
            ipv6_neighbor = False           # Reachable IPv6 Neighbors

            poe = True                      # POE metrics
            monitor = True                  # Interface monitor metrics
            netwatch = True                 # Netwatch metrics
            public_ip = True                # Public IP metrics
            route = True                    # Routes metrics
            wireless = True                 # WLAN general metrics
            wireless_clients = True         # WLAN clients metrics
            capsman = True                  # CAPsMAN general metrics
            capsman_clients = True          # CAPsMAN clients metrics

            user = True                     # Active Users metrics
            queue = True                    # Queues metrics

            remote_dhcp_entry = None        # An MKTXP entry for remote DHCP info resolution (capsman/wireless)

            use_comments_over_names = True  # when available, forces using comments over the interfaces names

            check_for_updates = False       # check for available ROS updates

      _mktxp.conf: |
        [MKTXP]
          port = 49090
          socket_timeout = 2

          initial_delay_on_failure = 120
          max_delay_on_failure = 900
          delay_inc_div = 5

          bandwidth = True               # Turns metrics bandwidth metrics collection on / off
          bandwidth_test_interval = 3600   # Interval for colllecting bandwidth metrics
          minimal_collect_interval = 5    # Minimal metric collection interval

          verbose_mode = True            # Set it on for troubleshooting

          fetch_routers_in_parallel = False   # Set to True if you want to fetch multiple routers parallel
          max_worker_threads = 5              # Max number of worker threads that can fetch routers (parallel fetch only)
          max_scrape_duration = 10            # Max duration of individual routers' metrics collection (parallel fetch only)
          total_max_scrape_duration = 30      # Max overall duration of all metrics collection (parallel fetch only)

          # Required since mktxp 1.2.x: the auto-migration on first boot
          # writes this key; if the running user cannot write _mktxp.conf
          # the migration silently fails and mktxp then crashes with
          # KeyError: 'compact_default_conf_values' at startup.
          compact_default_conf_values = False

# -- ServiceMonitor to tell to prometheus to scrape metrics
metrics:
  enabled: true
  serviceMonitor:
    interval: 30s
    scrapeTimeout: 20s
    labels: {}
