feat(monitoring): manage proto support on prober

This commit is contained in:
WrenIX 2024-04-03 13:48:32 +02:00
parent 3a6f0ac0f7
commit 339ed7a218
Signed by: wrenix
GPG key ID: 7AFDB012974B1BB5
4 changed files with 35 additions and 13 deletions

View file

@ -3,7 +3,7 @@ name: monitoring
description: Deploy helper for probes and scrapeconfig of prometheus-operator description: Deploy helper for probes and scrapeconfig of prometheus-operator
icon: https://prometheus.io/assets/favicons/android-chrome-192x192.png icon: https://prometheus.io/assets/favicons/android-chrome-192x192.png
type: application type: application
version: 0.1.3 version: 0.2.0
maintainers: maintainers:
- name: WrenIX - name: WrenIX
url: https://wrenix.eu url: https://wrenix.eu

View file

@ -2,7 +2,7 @@
= monitoring = monitoring
image::https://img.shields.io/badge/Version-0.1.3-informational?style=flat-square[Version: 0.1.3] image::https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square[Version: 0.2.0]
image::https://img.shields.io/badge/Version-application-informational?style=flat-square[Type: application] image::https://img.shields.io/badge/Version-application-informational?style=flat-square[Type: application]
== Maintainers == Maintainers
@ -48,14 +48,24 @@ helm uninstall monitoring-release
| prober | prober
| list | list
| `[{"name":"local","spec":{"path":"/probe","url":"prometheus-blackbox-exporter:9115"}}]` | `[{"ipv4":true,"ipv6":true,"name":"local","spec":{"path":"/probe","url":"prometheus-blackbox-exporter:9115"}}]`
| prober for each the following probes are created (multiside probes) | prober for each the following probes are created (multiside probes)
| prober[0] | prober[0]
| object | object
| `{"name":"local","spec":{"path":"/probe","url":"prometheus-blackbox-exporter:9115"}}` | `{"ipv4":true,"ipv6":true,"name":"local","spec":{"path":"/probe","url":"prometheus-blackbox-exporter:9115"}}`
| name of prober | name of prober
| prober[0].ipv4
| bool
| `true`
| use this prober for ipv4 probes (default: true)
| prober[0].ipv6
| bool
| `true`
| use this prober for ipv6 probes (default: true)
| prober[0].spec | prober[0].spec
| object | object
| `{"path":"/probe","url":"prometheus-blackbox-exporter:9115"}` | `{"path":"/probe","url":"prometheus-blackbox-exporter:9115"}`
@ -74,12 +84,12 @@ helm uninstall monitoring-release
| probes[0].ipv4 | probes[0].ipv4
| bool | bool
| `true` | `true`
| setup one for ipv4 (see module and his suffix) | setup one for ipv4 (see module and his suffix - default: true)
| probes[0].ipv6 | probes[0].ipv6
| bool | bool
| `true` | `true`
| setup one for ipv6 (see module and his suffix) | setup one for ipv6 (see module and his suffix - default: true)
| probes[0].name | probes[0].name
| string | string
@ -94,12 +104,12 @@ helm uninstall monitoring-release
| probes[1].ipv4 | probes[1].ipv4
| bool | bool
| `true` | `true`
| setup one for ipv4 (see module and his suffix) | setup one for ipv4 (see module and his suffix - default: true)
| probes[1].ipv6 | probes[1].ipv6
| bool | bool
| `false` | `false`
| setup one for ipv6 (see module and his suffix) | setup one for ipv6 (see module and his suffix - default: true)
| probes[1].module | probes[1].module
| string | string

View file

@ -3,7 +3,15 @@
{{- range $groupName, $group := $probe.groups }} {{- range $groupName, $group := $probe.groups }}
{{- $proto := "ipv4" }} {{- $proto := "ipv4" }}
{{- range $proto := (list "ipv4" "ipv6") }} {{- range $proto := (list "ipv4" "ipv6") }}
{{- if (get $probe $proto) }} {{- if and
(or
(not (hasKey $probe $proto))
(get $probe $proto)
)
(or
(not (hasKey $prober $proto))
(get $prober $proto)
) }}
--- ---
apiVersion: monitoring.coreos.com/v1 apiVersion: monitoring.coreos.com/v1
kind: Probe kind: Probe

View file

@ -45,6 +45,10 @@ scrapes:
prober: prober:
# -- name of prober # -- name of prober
- name: "local" - name: "local"
# -- use this prober for ipv4 probes (default: true)
ipv4: true
# -- use this prober for ipv6 probes (default: true)
ipv6: true
# -- spec of prober (like url, path, scheme ...) # -- spec of prober (like url, path, scheme ...)
spec: spec:
url: "prometheus-blackbox-exporter:9115" url: "prometheus-blackbox-exporter:9115"
@ -55,9 +59,9 @@ probes:
- module: http_2xx - module: http_2xx
# -- name of probe # -- name of probe
name: http name: http
# -- setup one for ipv4 (see module and his suffix) # -- setup one for ipv4 (see module and his suffix - default: true)
ipv4: true ipv4: true
# -- setup one for ipv6 (see module and his suffix) # -- setup one for ipv6 (see module and his suffix - default: true)
ipv6: true ipv6: true
# -- groups with targets # -- groups with targets
groups: groups:
@ -71,9 +75,9 @@ probes:
- module: http_2xx - module: http_2xx
# -- name of probe # -- name of probe
name: http-ipv4 name: http-ipv4
# -- setup one for ipv4 (see module and his suffix) # -- setup one for ipv4 (see module and his suffix - default: true)
ipv4: true ipv4: true
# -- setup one for ipv6 (see module and his suffix) # -- setup one for ipv6 (see module and his suffix - default: true)
ipv6: false ipv6: false
# -- groups with targets # -- groups with targets
groups: groups: