[promcord] move to servicemonitor (#1163)

This commit is contained in:
j_r0dd 2021-09-07 11:56:18 -04:00 committed by GitHub
parent 4aa2b5e2d6
commit 1cab628960
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 46 additions and 28 deletions

View File

@ -2,7 +2,7 @@ apiVersion: v2
appVersion: latest
description: Discord bot that provides metrics from a Discord server
name: promcord
version: 3.0.0
version: 4.0.0
kubeVersion: ">=1.16.0-0"
keywords:
- promcord

View File

@ -1,6 +1,6 @@
# promcord
![Version: 3.0.0](https://img.shields.io/badge/Version-3.0.0-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)
![Version: 4.0.0](https://img.shields.io/badge/Version-4.0.0-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)
Discord bot that provides metrics from a Discord server
@ -80,7 +80,7 @@ N/A
| image.pullPolicy | string | `"IfNotPresent"` | image pull policy |
| image.repository | string | `"biospheere/promcord"` | image repository |
| image.tag | string | `"latest"` | image tag |
| prometheus.podMonitor | object | See values.yaml | Enable and configure a Prometheus podMonitor for the chart under this key. |
| prometheus.serviceMonitor | object | See values.yaml | Enable and configure a Prometheus podMonitor for the chart under this key. |
| service | object | See values.yaml | Configures service settings for the chart. |
## Changelog
@ -89,6 +89,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).
### [4.0.0]
#### Changed
- Switched to serviceMonitor instead of podMonitor. This is a potential breaking change.
### [2.0.0]
#### Changed
@ -107,6 +113,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- New chart
[4.0.0]: #400
[2.0.0]: #200
[1.0.1]: #101
[1.0.0]: #100

View File

@ -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).
### [4.0.0]
#### Changed
- Switched to serviceMonitor instead of podMonitor. This is a potential breaking change.
### [2.0.0]
#### Changed
@ -27,6 +33,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- New chart
[4.0.0]: #400
[2.0.0]: #200
[1.0.1]: #101
[1.0.0]: #100

View File

@ -1,24 +0,0 @@
{{- if .Values.prometheus.podMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ include "common.names.fullname" . }}
labels:
{{- include "common.labels" . | nindent 4 }}
{{- with .Values.prometheus.podMonitor.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
{{- include "common.labels.selectorLabels" . | nindent 6 }}
podMetricsEndpoints:
- port: http
{{- with .Values.prometheus.podMonitor.interval }}
interval: {{ . }}
{{- end }}
{{- with .Values.prometheus.podMonitor.scrapeTimeout }}
scrapeTimeout: {{ . }}
{{- end }}
path: /metrics
{{- end }}

View File

@ -0,0 +1,24 @@
{{- if .Values.prometheus.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "common.names.fullname" . }}
labels:
{{- include "common.labels" . | nindent 4 }}
{{- with .Values.prometheus.serviceMonitor.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
{{- include "common.labels.selectorLabels" . | nindent 6 }}
endpoints:
- port: metrics
{{- with .Values.prometheus.serviceMonitor.interval }}
interval: {{ . }}
{{- end }}
{{- with .Values.prometheus.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ . }}
{{- end }}
path: /metrics
{{- end }}

View File

@ -19,6 +19,10 @@ service:
main:
ports:
http:
enabled: false
metrics:
enabled: true
protocol: TCP
port: 8080
# -- environment variables. See [application docs](https://github.com/nimarion/promcord/blob/master/README.md) for more details.
@ -32,7 +36,7 @@ env:
prometheus:
# -- Enable and configure a Prometheus podMonitor for the chart under this key.
# @default -- See values.yaml
podMonitor:
serviceMonitor:
enabled: false
interval: 1m
scrapeTimeout: 30s