This repository has been archived by the owner on Aug 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 619
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mqtt-exporter] Add new chart (#1584)
* added mqtt-exporter * added servicemonitor * fix interval * fix timeout * exclude from ct * docs * Update charts/stable/mqtt-exporter/values.yaml Co-authored-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev> * Update charts/stable/mqtt-exporter/values.yaml Co-authored-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev> * Update charts/stable/mqtt-exporter/values.yaml Co-authored-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev> * Update charts/stable/mqtt-exporter/values.yaml Co-authored-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev> * Update charts/stable/mqtt-exporter/values.yaml Co-authored-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev> * Update charts/stable/mqtt-exporter/values.yaml Co-authored-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev> * Update charts/stable/mqtt-exporter/values.yaml Co-authored-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev> * Update charts/stable/mqtt-exporter/values.yaml Co-authored-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev> * Update charts/stable/mqtt-exporter/values.yaml Co-authored-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev> * Update charts/stable/mqtt-exporter/values.yaml Co-authored-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev> * Update charts/stable/mqtt-exporter/values.yaml Co-authored-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev> * Update charts/stable/mqtt-exporter/values.yaml Co-authored-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev> * Update charts/stable/mqtt-exporter/templates/servicemonitor.yaml Co-authored-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev> * Update charts/stable/mqtt-exporter/values.yaml Co-authored-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev> * fix ci * fix docs * fixes * Update values.yaml * Update values.yaml Co-authored-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev>
- Loading branch information
1 parent
7a849b1
commit 93b52f1
Showing
9 changed files
with
248 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ | ||
# OWNERS file for Kubernetes | ||
OWNERS | ||
# helm-docs templates | ||
*.gotmpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
apiVersion: v2 | ||
appVersion: 1.0.0 | ||
description: Simple and generic Prometheus exporter for MQTT. Tested with Mosquitto MQTT and Xiaomi sensors. | ||
name: mqtt-exporter | ||
version: 1.0.0 | ||
kubeVersion: ">=1.16.0-0" | ||
keywords: | ||
- zigbee2mqtt | ||
- prometheus | ||
home: https://github.com/k8s-at-home/charts/tree/master/charts/stable/mqtt-exporter | ||
icon: https://static.veritone.com/assets/favicon/favicon.ico | ||
sources: | ||
- https://github.com/kpetremann/mqtt-exporter | ||
- https://hub.docker.com/r/kpetrem/mqtt-exporter | ||
maintainers: | ||
- name: philipp | ||
email: phil@hellmi.de | ||
dependencies: | ||
- name: common | ||
repository: https://library-charts.k8s-at-home.com | ||
version: 4.4.2 | ||
annotations: | ||
artifacthub.io/changes: |- | ||
- kind: added | ||
description: Initial version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# mqtt-exporter | ||
|
||
![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square) | ||
|
||
Simple and generic Prometheus exporter for MQTT. Tested with Mosquitto MQTT and Xiaomi sensors. | ||
|
||
**Homepage:** <https://github.com/k8s-at-home/charts/tree/master/charts/stable/mqtt-exporter> | ||
|
||
## Maintainers | ||
|
||
| Name | Email | Url | | ||
| ---- | ------ | --- | | ||
| philipp | phil@hellmi.de | | | ||
|
||
## Source Code | ||
|
||
* <https://github.com/kpetremann/mqtt-exporter> | ||
* <https://hub.docker.com/r/kpetrem/mqtt-exporter> | ||
|
||
## Requirements | ||
|
||
Kubernetes: `>=1.16.0-0` | ||
|
||
| Repository | Name | Version | | ||
|------------|------|---------| | ||
| https://library-charts.k8s-at-home.com | common | 4.4.2 | | ||
|
||
## Values | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| env | object | See below | environment variables. See [image docs](https://developer.us-1.veritone.com/machinebox/overview) for more details. | | ||
| env.LOG_LEVEL | string | `"INFO"` | Logging level | | ||
| env.MQTT_ADDRESS | string | `"127.0.0.1"` | IP or hostname of MQTT broker | | ||
| env.MQTT_IGNORED_TOPICS | string | `nil` | Comma-separated lists of topics to ignore. Accepts wildcards. | | ||
| env.MQTT_KEEPALIVE | int | `60` | Keep alive interval to maintain connection with MQTT broker | | ||
| env.MQTT_PASSWORD | string | `nil` | Password which should be used to authenticate against the MQTT broker | | ||
| env.MQTT_PORT | int | `1883` | TCP port of MQTT broker | | ||
| env.MQTT_TOPIC | string | `"#"` | Topic path to subscribe to | | ||
| env.MQTT_USERNAME | string | `nil` | Username which should be used to authenticate against the MQTT broker | | ||
| env.PROMETHEUS_PORT | int | `9000` | HTTP server PORT to expose Prometheus metrics | | ||
| env.PROMETHEUS_PREFIX | string | `"mqtt_"` | Prefix added to the metric name, example: mqtt_temperature | | ||
| env.TOPIC_LABEL | string | `"topic"` | Define the Prometheus label for the topic, example temperature{topic="device1"} | | ||
| env.TZ | string | `"UTC"` | Set the container timezone | | ||
| env.ZIGBEE2MQTT_AVAILABILITY | string | `"False"` | Normalize sensor name for device availability metric added by Zigbee2MQTT | | ||
| image.pullPolicy | string | `"IfNotPresent"` | image pull policy | | ||
| image.repository | string | `"kpetrem/mqtt-exporter"` | image repository | | ||
| image.tag | string | `"latest"` | image tag | | ||
| ingress.main | object | See values.yaml | Enable and configure ingress settings for the chart under this key. | | ||
| metrics.enabled | bool | See values.yaml | Enable and configure a Prometheus serviceMonitor for the chart under this key. | | ||
| metrics.serviceMonitor.interval | string | `"30s"` | Interval at which Prometheus should scrape metrics | | ||
| metrics.serviceMonitor.labels | object | `{}` | Additional labels for the Kubernetes `ServiceMonitor` object | | ||
| metrics.serviceMonitor.scrapeTimeout | string | `"10s"` | Timeout after which the scrape is ended | | ||
| persistence | object | See values.yaml | Configure persistence settings for the chart under this key. | | ||
| securityContext.capabilities.drop[0] | string | `"ALL"` | | | ||
| securityContext.readOnlyRootFilesystem | bool | `true` | | | ||
| securityContext.runAsNonRoot | bool | `true` | | | ||
| securityContext.runAsUser | int | `65534` | | | ||
| service | object | See values.yaml | Configures service settings for the chart. | | ||
|
||
---------------------------------------------- | ||
Autogenerated from chart metadata using [helm-docs v1.5.0](https://github.com/norwoodj/helm-docs/releases/v1.5.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{{- define "custom.custom.configuration.header" -}} | ||
## Custom configuration | ||
{{- end -}} | ||
|
||
{{- define "custom.custom.configuration" -}} | ||
{{ template "custom.custom.configuration.header" . }} | ||
|
||
N/A | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Test | ||
|
||
additionalContainers: | ||
mosquitto: | ||
name: mosquitto | ||
image: eclipse-mosquitto:1.6.8 | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- name: mqtt | ||
containerPort: 1883 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{- include "common.notes.defaultNotes" . -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{ include "common.all" . }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{{- if .Values.metrics.enabled }} | ||
{{- include "common.values.setup" . -}} | ||
--- | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: {{ include "common.names.fullname" . }} | ||
labels: | ||
{{- include "common.labels" . | nindent 4 }} | ||
{{- with .Values.metrics.serviceMonitor.labels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
annotations: | ||
{{- include "common.annotations" . | nindent 4 }} | ||
spec: | ||
selector: | ||
matchLabels: | ||
{{- include "common.labels.selectorLabels" . | nindent 6 }} | ||
endpoints: | ||
- port: http | ||
{{- with .Values.metrics.serviceMonitor.interval }} | ||
interval: {{ . }} | ||
{{- end }} | ||
{{- with .Values.metrics.serviceMonitor.scrapeTimeout }} | ||
scrapeTimeout: {{ . }} | ||
{{- end }} | ||
path: /metrics | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# | ||
# 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: kpetrem/mqtt-exporter | ||
# -- image tag | ||
tag: latest | ||
# -- image pull policy | ||
pullPolicy: IfNotPresent | ||
|
||
# -- environment variables. See [image docs](https://developer.us-1.veritone.com/machinebox/overview) for more details. | ||
# @default -- See below | ||
env: | ||
# -- Set the container timezone | ||
TZ: UTC | ||
# -- Logging level | ||
LOG_LEVEL: INFO | ||
# -- Comma-separated lists of topics to ignore. Accepts wildcards. | ||
MQTT_IGNORED_TOPICS: | ||
# -- IP or hostname of MQTT broker | ||
MQTT_ADDRESS: 127.0.0.1 | ||
# -- TCP port of MQTT broker | ||
MQTT_PORT: 1883 | ||
# -- Topic path to subscribe to | ||
MQTT_TOPIC: "#" | ||
# -- Keep alive interval to maintain connection with MQTT broker | ||
MQTT_KEEPALIVE: 60 | ||
# -- Username which should be used to authenticate against the MQTT broker | ||
MQTT_USERNAME: | ||
# -- Password which should be used to authenticate against the MQTT broker | ||
MQTT_PASSWORD: | ||
# -- HTTP server PORT to expose Prometheus metrics | ||
PROMETHEUS_PORT: 9000 | ||
# -- Prefix added to the metric name, example: mqtt_temperature | ||
PROMETHEUS_PREFIX: mqtt_ | ||
# -- Define the Prometheus label for the topic, example temperature{topic="device1"} | ||
TOPIC_LABEL: topic | ||
# -- Normalize sensor name for device availability metric added by Zigbee2MQTT | ||
ZIGBEE2MQTT_AVAILABILITY: "False" | ||
|
||
# -- Configures service settings for the chart. | ||
# @default -- See values.yaml | ||
service: | ||
main: | ||
ports: | ||
http: | ||
port: 9000 | ||
|
||
metrics: | ||
# -- Enable and configure a Prometheus serviceMonitor for the chart under this key. | ||
# @default -- See values.yaml | ||
enabled: false | ||
serviceMonitor: | ||
# -- Interval at which Prometheus should scrape metrics | ||
interval: 30s | ||
# -- Timeout after which the scrape is ended | ||
scrapeTimeout: 10s | ||
# -- Additional labels for the Kubernetes `ServiceMonitor` object | ||
labels: {} | ||
|
||
ingress: | ||
# -- Enable and configure ingress settings for the chart under this key. | ||
# @default -- See values.yaml | ||
main: | ||
enabled: false | ||
|
||
# -- Configure persistence settings for the chart under this key. | ||
# @default -- See values.yaml | ||
persistence: | ||
config: | ||
enabled: false | ||
mountPath: /conf | ||
|
||
securityContext: | ||
capabilities: | ||
drop: | ||
- ALL | ||
readOnlyRootFilesystem: true | ||
runAsNonRoot: true | ||
runAsUser: 65534 |