fix(speedtest-exporter): allow write to filesystem and move to stable

This commit is contained in:
kjeld Schouten-Lebbing
2021-11-24 23:52:08 +01:00
parent 3db44016d0
commit 505aec0ed5
11 changed files with 4 additions and 1 deletions
@@ -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
@@ -0,0 +1,18 @@
# Changelog<br>
<a name="speedtest-exporter-0.0.2"></a>
### [speedtest-exporter-0.0.2](https://github.com/truecharts/apps/compare/speedtest-exporter-0.0.1...speedtest-exporter-0.0.2) (2021-11-23)
#### Chore
* update non-major ([#1390](https://github.com/truecharts/apps/issues/1390))
<a name="speedtest-exporter-0.0.1"></a>
### speedtest-exporter-0.0.1 (2021-11-23)
#### Feat
* add some prometheus exporter-Apps ([#1388](https://github.com/truecharts/apps/issues/1388))
@@ -0,0 +1,8 @@
# Configuration Options
##### Connecting to other apps
If you need to connect this App to other Apps on TrueNAS SCALE, please refer to our "Linking Apps Internally" quick-start guide:
https://truecharts.org/manual/Quick-Start%20Guides/14-linking-apps/
##### Available config options
In the future this page is going to contain an automated list of options available in the installation/edit UI.
@@ -0,0 +1,29 @@
apiVersion: v2
appVersion: "3.3.4"
dependencies:
- name: common
repository: https://truecharts.org
version: 8.9.3
deprecated: false
description: Speedtest Exporter made in python using the official speedtest bin
icon: https://raw.githubusercontent.com/prometheus/prometheus.github.io/master/assets/prometheus_logo-cb55bb5c346.png
home: https://github.com/k8s-at-home/charts/tree/master/charts/stable/speedtest-exporter
keywords:
- speedtest-exporter
- speedtest
- metrics
kubeVersion: '>=1.16.0-0'
maintainers:
- email: info@truecharts.org
name: TrueCharts
url: https://truecharts.org
name: speedtest-exporter
sources:
- https://github.com/MiguelNdeCarvalho/speedtest-exporter/
type: application
version: 1.0.0
annotations:
truecharts.org/catagories: |
- metrics
truecharts.org/SCALE-support: "true"
truecharts.org/grade: U
@@ -0,0 +1,37 @@
# Introduction
Speedtest Exporter made in python using the official speedtest bin
TrueCharts are designed to be installed as TrueNAS SCALE app only. We can not guarantee this charts works as a stand-alone helm installation.
**This chart is not maintained by the upstream project and any issues with the chart should be raised [here](https://github.com/truecharts/apps/issues/new/choose)**
## Source Code
* <https://github.com/MiguelNdeCarvalho/speedtest-exporter/>
## Requirements
Kubernetes: `>=1.16.0-0`
## Dependencies
| Repository | Name | Version |
|------------|------|---------|
| https://truecharts.org | common | 8.9.3 |
## Installing the Chart
To install this App on TrueNAS SCALE check our [Quick-Start Guide](https://truecharts.org/manual/Quick-Start%20Guides/03-Installing-an-App/).
## Uninstalling the Chart
To remove this App from TrueNAS SCALE check our [Quick-Start Guide](https://truecharts.org/manual/Quick-Start%20Guides/07-Deleting-an-App/).
## Support
- Please check our [quick-start guides](https://truecharts.org/manual/Quick-Start%20Guides/01-Open-Apps/) first.
- See the [Wiki](https://truecharts.org)
- Check our [Discord](https://discord.gg/tVsPTHWTtr)
- Open a [issue](https://github.com/truecharts/apps/issues/new/choose)
---
All Rights Reserved - The TrueCharts Project
@@ -0,0 +1,31 @@
# Default Helm-Values
TrueCharts is primarily build to supply TrueNAS SCALE Apps.
However, we also supply all Apps as standard Helm-Charts. In this document we aim to document the default values in our values.yaml file.
Most of our Apps also consume our "common" Helm Chart.
If this is the case, this means that all values.yaml values are set to the common chart values.yaml by default. This values.yaml file will only contain values that deviate from the common chart.
You will, however, be able to use all values referenced in the common chart here, besides the values listed in this document.
## Values
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| env | object | See below | environment variables. See [application docs](https://docs.miguelndecarvalho.pt/projects/speedtest-exporter/) for more details. |
| env.TZ | string | `"UTC"` | Set the container timezone |
| image.pullPolicy | string | `"IfNotPresent"` | image pull policy |
| image.repository | string | `"ghcr.io/miguelndecarvalho/speedtest-exporter"` | image repository |
| image.tag | string | `"v3.3.4"` | image tag |
| metrics.enabled | bool | See values.yaml | Enable and configure a Prometheus serviceMonitor for the chart under this key. |
| metrics.prometheusRule | object | See values.yaml | Enable and configure Prometheus Rules for the chart under this key. |
| metrics.prometheusRule.downloadLimit | int | `400` | Download speed you want alerts to be triggered in Mbps |
| metrics.prometheusRule.jitterLimit | int | `30` | Jitter latency you want alerts to be triggered in ms |
| metrics.prometheusRule.pingLimit | int | `10` | Ping latency you want alerts to be triggered in ms |
| metrics.prometheusRule.rules | list | See prometheusrules.yaml | Configure additionial rules for the chart under this key. |
| metrics.prometheusRule.uploadLimit | int | `400` | Upload speed you want alerts to be triggered in Mbps |
| metrics.serviceMonitor.interval | string | `"60m"` | The interval field must use minutes for the padding to calculate properly. |
| metrics.serviceMonitor.labels | object | `{}` | |
| metrics.serviceMonitor.scrapeTimeout | string | `"1m"` | |
| service | object | See values.yaml | Configures service settings for the chart. |
All Rights Reserved - The TrueCharts Project
@@ -0,0 +1,151 @@
# Include{groups}
portals: {}
questions:
# Include{global}
- variable: env
group: "Container Configuration"
label: "Image Environment"
schema:
type: dict
attrs:
# Include{fixedEnv}
# Include{containerConfig}
- variable: serviceexpert
group: "Networking and Services"
label: "Show Expert Config"
schema:
type: boolean
default: false
show_subquestions_if: true
subquestions:
- variable: hostNetwork
group: "Networking and Services"
label: "Host-Networking (Complicated)"
schema:
type: boolean
default: false
# Include{serviceExpert}
# Include{serviceList}
# Include{persistenceList}
# Include{ingressList}
- variable: advancedSecurity
label: "Show Advanced Security Settings"
group: "Security and Permissions"
schema:
type: boolean
default: false
show_subquestions_if: true
subquestions:
- variable: securityContext
label: "Security Context"
schema:
type: dict
attrs:
- variable: privileged
label: "Privileged mode"
schema:
type: boolean
default: false
- variable: readOnlyRootFilesystem
label: "ReadOnly Root Filesystem"
schema:
type: boolean
default: false
- variable: allowPrivilegeEscalation
label: "Allow Privilege Escalation"
schema:
type: boolean
default: false
- variable: runAsNonRoot
label: "runAsNonRoot"
schema:
type: boolean
default: true
- variable: podSecurityContext
group: "Security and Permissions"
label: "Pod Security Context"
schema:
type: dict
attrs:
- variable: runAsUser
label: "runAsUser"
description: "The UserID of the user running the application"
schema:
type: int
default: 568
- variable: runAsGroup
label: "runAsGroup"
description: The groupID this App of the user running the application"
schema:
type: int
default: 568
- variable: fsGroup
label: "fsGroup"
description: "The group that should own ALL storage."
schema:
type: int
default: 568
- variable: supplementalGroups
label: "supplemental Groups"
schema:
type: list
default: []
items:
- variable: supplementalGroupsEntry
label: "supplemental Group"
schema:
type: int
- variable: fsGroupChangePolicy
label: "When should we take ownership?"
schema:
type: string
default: "OnRootMismatch"
enum:
- value: "OnRootMismatch"
description: "OnRootMismatch"
- value: "Always"
description: "Always"
# Include{resources}
# Include{metrics}
# Include{prometheusRule}
- variable: downloadLimit
label: "Download Limit"
description: "Download speed you want alerts to be triggered in Mbps"
schema:
type: int
default: 400
- variable: uploadLimit
label: "Upload Limit"
description: "Upload speed you want alerts to be triggered in Mbps"
schema:
type: int
default: 400
- variable: pingLimit
label: "Ping Limit"
description: "Ping latency you want alerts to be triggered in ms"
schema:
type: int
default: 10
- variable: jitterLimit
label: "Jitter Limit"
description: "Jitter latency you want alerts to be triggered in ms"
schema:
type: int
default: 30
# Include{advanced}
# Include{addons}
@@ -0,0 +1 @@
{{ include "common.all" . }}
@@ -0,0 +1,67 @@
{{- 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: SpeedtestExporterAbsent
annotations:
description: Speedtest Exporter has disappeared from Prometheus target discovery.
summary: Speedtest Exporter is down.
expr: |
absent(up{job=~".*{{ include "common.names.fullname" . }}.*"} == 1)
for: {{ trimAll "m" .Values.metrics.serviceMonitor.interval | add 15 }}m
labels:
severity: critical
- 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
- alert: SpeedtestSlowInternetUpload
annotations:
description: Internet upload speed is averaging {{ "{{ humanize $value }}" }} Mbps.
summary: SpeedTest slow internet upload.
expr: |
avg_over_time(speedtest_upload_bits_per_second{job=~".*{{ include "common.names.fullname" . }}.*"}[4h])
< {{ .Values.metrics.prometheusRule.uploadLimit }}
for: 0m
labels:
severity: warning
- alert: SpeedtestHighPingLatency
annotations:
description: Internet ping latency is averaging {{ "{{ humanize $value }}" }} ms.
summary: SpeedTest high ping latency.
expr: |
avg_over_time(speedtest_ping_latency_milliseconds{job=~".*{{ include "common.names.fullname" . }}.*"}[4h])
> {{ .Values.metrics.prometheusRule.pingLimit }}
for: 0m
labels:
severity: warning
- alert: SpeedtestHighJitterLatency
annotations:
description: Internet jitter latency is averaging {{ "{{ humanize $value }}" }} ms.
summary: SpeedTest high jitter latency.
expr: |
avg_over_time(speedtest_jitter_latency_milliseconds{job=~".*{{ include "common.names.fullname" . }}.*"}[4h])
> {{ .Values.metrics.prometheusRule.jitterLimit }}
for: 0m
labels:
severity: warning
{{- with .Values.metrics.prometheusRule.rules }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
@@ -0,0 +1,24 @@
{{- if .Values.metrics.enabled }}
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 }}
spec:
selector:
matchLabels:
{{- include "common.labels.selectorLabels" . | nindent 6 }}
endpoints:
- port: metrics
{{- with .Values.metrics.serviceMonitor.interval }}
interval: {{ . }}
{{- end }}
{{- with .Values.metrics.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ . }}
{{- end }}
path: /metrics
{{- end }}
@@ -0,0 +1,64 @@
image:
# -- image repository
repository: ghcr.io/miguelndecarvalho/speedtest-exporter
# -- image tag
tag: v3.3.4
# -- 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
securityContext:
readOnlyRootFilesystem: false
# -- Configures service settings for the chart.
# @default -- See values.yaml
service:
main:
ports:
main:
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