mirror of
https://github.com/k8s-at-home/charts.git
synced 2025-02-03 07:49:03 +00:00
[unifi-poller] metrics refactor (#1182)
Co-authored-by: ᗪєνιη ᗷυнʟ <onedr0p@users.noreply.github.com>
This commit is contained in:
parent
c3017ec800
commit
faec4db9ef
@ -2,7 +2,7 @@ apiVersion: v2
|
|||||||
appVersion: 2.1.3
|
appVersion: 2.1.3
|
||||||
description: Collect ALL UniFi Controller, Site, Device & Client Data - Export to InfluxDB or Prometheus
|
description: Collect ALL UniFi Controller, Site, Device & Client Data - Export to InfluxDB or Prometheus
|
||||||
name: unifi-poller
|
name: unifi-poller
|
||||||
version: 9.0.0
|
version: 10.0.0
|
||||||
kubeVersion: ">=1.16.0-0"
|
kubeVersion: ">=1.16.0-0"
|
||||||
keywords:
|
keywords:
|
||||||
- unifi
|
- unifi
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# unifi-poller
|
# unifi-poller
|
||||||
|
|
||||||
![Version: 9.0.0](https://img.shields.io/badge/Version-9.0.0-informational?style=flat-square) ![AppVersion: 2.1.3](https://img.shields.io/badge/AppVersion-2.1.3-informational?style=flat-square)
|
![Version: 10.0.0](https://img.shields.io/badge/Version-10.0.0-informational?style=flat-square) ![AppVersion: 2.1.3](https://img.shields.io/badge/AppVersion-2.1.3-informational?style=flat-square)
|
||||||
|
|
||||||
Collect ALL UniFi Controller, Site, Device & Client Data - Export to InfluxDB or Prometheus
|
Collect ALL UniFi Controller, Site, Device & Client Data - Export to InfluxDB or Prometheus
|
||||||
|
|
||||||
@ -87,10 +87,16 @@ N/A
|
|||||||
| influxdb.enabled | bool | `false` | Create an InfluxDB instance as a [unifi-poller storage backend](https://unifipoller.com/docs/dependencies/influxdb). See [bitnami/influxdb](https://github.com/bitnami/charts/tree/master/bitnami/influxdb) for more options. |
|
| influxdb.enabled | bool | `false` | Create an InfluxDB instance as a [unifi-poller storage backend](https://unifipoller.com/docs/dependencies/influxdb). See [bitnami/influxdb](https://github.com/bitnami/charts/tree/master/bitnami/influxdb) for more options. |
|
||||||
| influxdb.persistence.enabled | bool | `false` | Enable persistence to store in a PV so data survives pod restarts. |
|
| influxdb.persistence.enabled | bool | `false` | Enable persistence to store in a PV so data survives pod restarts. |
|
||||||
| ingress.main.enabled | bool | `false` | Expose [unifi-poller's web interface](https://unifipoller.com/docs/advanced/webserver) (if enabled in the configuration) via the k8s ingress by setting this true. |
|
| ingress.main.enabled | bool | `false` | Expose [unifi-poller's web interface](https://unifipoller.com/docs/advanced/webserver) (if enabled in the configuration) via the k8s ingress by setting this true. |
|
||||||
| prometheus.serviceMonitor.additionalLabels | object | `{}` | More labels to add to the ServiceMonitor resource. |
|
| metrics.enabled | bool | See values.yaml | Enable and configure a Prometheus serviceMonitor for the chart under this key. |
|
||||||
| prometheus.serviceMonitor.enabled | bool | `false` | Create a [ServiceMonitor](https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/design.md#servicemonitor) for the [unifi-poller prometheus exporter](https://unifipoller.com/docs/dependencies/prometheus) that is recognized by [prometheus-operator](https://github.com/prometheus-operator/prometheus-operator). This gets created in this chart's namespace. Note: this only creates a ServiceMonitor, not a prometheus instance. |
|
| metrics.prometheusRule | object | See values.yaml | Enable and configure Prometheus Rules for the chart under this key. |
|
||||||
| prometheus.serviceMonitor.interval | string | `"1m"` | Prometheus [endpoint polling interval](https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#endpoint) for this ServiceMonitor (how often unifi-poller will be queried). |
|
| metrics.prometheusRule.rules | list | See prometheusrules.yaml | Configure additionial rules for the chart under this key. |
|
||||||
| service.main.ports.http.port | int | `9130` | The port this prometheus exporter will listen on ([registered as 9130](https://github.com/prometheus/prometheus/wiki/Default-port-allocations)). This should match unifi-poller's [configured listen port](https://unifipoller.com/docs/install/configuration#prometheus). |
|
| metrics.serviceMonitor.interval | string | `"30s"` | |
|
||||||
|
| metrics.serviceMonitor.labels | object | `{}` | |
|
||||||
|
| metrics.serviceMonitor.scrapeTimeout | string | `"10s"` | |
|
||||||
|
| service.main.ports.http.enabled | bool | `false` | |
|
||||||
|
| service.main.ports.metrics.enabled | bool | `true` | |
|
||||||
|
| service.main.ports.metrics.port | int | `9130` | |
|
||||||
|
| service.main.ports.metrics.protocol | string | `"TCP"` | |
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
@ -98,6 +104,12 @@ All notable changes to this application Helm chart will be documented in this fi
|
|||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
### [10.0.0]
|
||||||
|
|
||||||
|
#### Changed
|
||||||
|
|
||||||
|
- **BREAKING**: Refactored Prometheus metrics section to add rules. Enabling metrics automatically enables the serviceMonitor.
|
||||||
|
|
||||||
### [9.0.0]
|
### [9.0.0]
|
||||||
|
|
||||||
#### Changed
|
#### Changed
|
||||||
@ -113,6 +125,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||||||
- **BREAKING**: Change the default influxdb database name to match unifi-poller's default
|
- **BREAKING**: Change the default influxdb database name to match unifi-poller's default
|
||||||
- Updates default unifi-poller version from 2.0.1 to 2.1.3
|
- Updates default unifi-poller version from 2.0.1 to 2.1.3
|
||||||
|
|
||||||
|
[10.0.0]: #1000
|
||||||
[9.0.0]: #900
|
[9.0.0]: #900
|
||||||
[8.0.0]: #800
|
[8.0.0]: #800
|
||||||
|
|
||||||
|
@ -9,6 +9,12 @@ All notable changes to this application Helm chart will be documented in this fi
|
|||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
### [10.0.0]
|
||||||
|
|
||||||
|
#### Changed
|
||||||
|
|
||||||
|
- **BREAKING**: Refactored Prometheus metrics section to add rules. Enabling metrics automatically enables the serviceMonitor.
|
||||||
|
|
||||||
### [9.0.0]
|
### [9.0.0]
|
||||||
|
|
||||||
#### Changed
|
#### Changed
|
||||||
@ -24,6 +30,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||||||
- **BREAKING**: Change the default influxdb database name to match unifi-poller's default
|
- **BREAKING**: Change the default influxdb database name to match unifi-poller's default
|
||||||
- Updates default unifi-poller version from 2.0.1 to 2.1.3
|
- Updates default unifi-poller version from 2.0.1 to 2.1.3
|
||||||
|
|
||||||
|
[10.0.0]: #1000
|
||||||
[9.0.0]: #900
|
[9.0.0]: #900
|
||||||
[8.0.0]: #800
|
[8.0.0]: #800
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
27
charts/stable/unifi-poller/templates/prometheusrules.yaml
Normal file
27
charts/stable/unifi-poller/templates/prometheusrules.yaml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
{{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled }}
|
||||||
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
kind: PrometheusRule
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
labels:
|
||||||
|
{{- include "common.labels" . | nindent 4 }}
|
||||||
|
{{- with .Values.metrics.prometheusRule.labels }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
groups:
|
||||||
|
- name: {{ include "common.names.fullname" . }}
|
||||||
|
rules:
|
||||||
|
- alert: UnifiPollerAbsent
|
||||||
|
annotations:
|
||||||
|
description: Unifi Poller has disappeared from Prometheus service discovery.
|
||||||
|
summary: Unifi Poller is down.
|
||||||
|
expr: |
|
||||||
|
absent(up{job=~".*{{ include "common.names.fullname" . }}.*"} == 1)
|
||||||
|
for: 5m
|
||||||
|
labels:
|
||||||
|
severity: critical
|
||||||
|
{{- with .Values.metrics.prometheusRule.rules }}
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
@ -1,11 +1,11 @@
|
|||||||
{{- if .Values.prometheus.serviceMonitor.enabled }}
|
{{- if .Values.metrics.enabled }}
|
||||||
apiVersion: monitoring.coreos.com/v1
|
apiVersion: monitoring.coreos.com/v1
|
||||||
kind: ServiceMonitor
|
kind: ServiceMonitor
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "common.names.fullname" . }}
|
name: {{ include "common.names.fullname" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "common.labels" . | nindent 4 }}
|
{{- include "common.labels" . | nindent 4 }}
|
||||||
{{- with .Values.prometheus.serviceMonitor.additionalLabels }}
|
{{- with .Values.metrics.serviceMonitor.labels }}
|
||||||
{{- toYaml . | nindent 4 }}
|
{{- toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
@ -13,9 +13,12 @@ spec:
|
|||||||
matchLabels:
|
matchLabels:
|
||||||
{{- include "common.labels.selectorLabels" . | nindent 6 }}
|
{{- include "common.labels.selectorLabels" . | nindent 6 }}
|
||||||
endpoints:
|
endpoints:
|
||||||
- port: http
|
- port: metrics
|
||||||
{{- with .Values.prometheus.serviceMonitor.interval }}
|
{{- with .Values.metrics.serviceMonitor.interval }}
|
||||||
interval: {{ . }}
|
interval: {{ . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
path: /metrics
|
{{- with .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||||
|
scrapeTimeout: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
path: /metrics
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -28,8 +28,10 @@ service:
|
|||||||
main:
|
main:
|
||||||
ports:
|
ports:
|
||||||
http:
|
http:
|
||||||
# -- The port this prometheus exporter will listen on ([registered as 9130](https://github.com/prometheus/prometheus/wiki/Default-port-allocations)).
|
enabled: false
|
||||||
# This should match unifi-poller's [configured listen port](https://unifipoller.com/docs/install/configuration#prometheus).
|
metrics:
|
||||||
|
enabled: true
|
||||||
|
protocol: TCP
|
||||||
port: 9130
|
port: 9130
|
||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
@ -38,19 +40,6 @@ ingress:
|
|||||||
# (if enabled in the configuration) via the k8s ingress by setting this true.
|
# (if enabled in the configuration) via the k8s ingress by setting this true.
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
prometheus:
|
|
||||||
serviceMonitor:
|
|
||||||
# -- Create a [ServiceMonitor](https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/design.md#servicemonitor)
|
|
||||||
# for the [unifi-poller prometheus exporter](https://unifipoller.com/docs/dependencies/prometheus)
|
|
||||||
# that is recognized by [prometheus-operator](https://github.com/prometheus-operator/prometheus-operator).
|
|
||||||
# This gets created in this chart's namespace. Note: this only creates a ServiceMonitor, not a prometheus instance.
|
|
||||||
enabled: false
|
|
||||||
# -- Prometheus [endpoint polling interval](https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#endpoint)
|
|
||||||
# for this ServiceMonitor (how often unifi-poller will be queried).
|
|
||||||
interval: 1m
|
|
||||||
# -- More labels to add to the ServiceMonitor resource.
|
|
||||||
additionalLabels: {}
|
|
||||||
|
|
||||||
influxdb:
|
influxdb:
|
||||||
# -- Create an InfluxDB instance as a [unifi-poller storage backend](https://unifipoller.com/docs/dependencies/influxdb).
|
# -- Create an InfluxDB instance as a [unifi-poller storage backend](https://unifipoller.com/docs/dependencies/influxdb).
|
||||||
# See [bitnami/influxdb](https://github.com/bitnami/charts/tree/master/bitnami/influxdb) for more options.
|
# See [bitnami/influxdb](https://github.com/bitnami/charts/tree/master/bitnami/influxdb) for more options.
|
||||||
@ -68,3 +57,29 @@ influxdb:
|
|||||||
enabled: false
|
enabled: false
|
||||||
# storageClass: ""
|
# storageClass: ""
|
||||||
# size: 8Gi
|
# size: 8Gi
|
||||||
|
|
||||||
|
metrics:
|
||||||
|
# -- Enable and configure a Prometheus serviceMonitor for the chart under this key.
|
||||||
|
# @default -- See values.yaml
|
||||||
|
enabled: false
|
||||||
|
serviceMonitor:
|
||||||
|
interval: 1m
|
||||||
|
scrapeTimeout: 30s
|
||||||
|
labels: {}
|
||||||
|
# -- Enable and configure Prometheus Rules for the chart under this key.
|
||||||
|
# @default -- See values.yaml
|
||||||
|
prometheusRule:
|
||||||
|
enabled: false
|
||||||
|
labels: {}
|
||||||
|
# -- Configure additionial rules for the chart under this key.
|
||||||
|
# @default -- See prometheusrules.yaml
|
||||||
|
rules: []
|
||||||
|
# - alert: UnifiPollerAbsent
|
||||||
|
# annotations:
|
||||||
|
# description: Unifi Poller has disappeared from Prometheus service discovery.
|
||||||
|
# summary: Unifi Poller is down.
|
||||||
|
# expr: |
|
||||||
|
# absent(up{job=~".*unifi-poller.*"} == 1)
|
||||||
|
# for: 5m
|
||||||
|
# labels:
|
||||||
|
# severity: critical
|
||||||
|
Loading…
Reference in New Issue
Block a user