Skip to content

Commit

Permalink
feat(hedgedoc): Create ServiceMonitor resources
Browse files Browse the repository at this point in the history
  • Loading branch information
hairmare committed Nov 27, 2023
1 parent 6951632 commit 5b01fd2
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 7 deletions.
9 changes: 3 additions & 6 deletions charts/hedgedoc/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: v2
name: hedgedoc
description: Chart for HedgeDoc, a fork of CodiMD
type: application
version: 0.3.1
version: 0.4.0
appVersion: "1.9.9"
icon: https://raw.githubusercontent.com/hedgedoc/hedgedoc-logo/main/LOGOTYPE/PNG/HedgeDoc-Logo%201.png
sources:
Expand All @@ -22,8 +22,5 @@ annotations:
- name: hedgedoc
image: quay.io/hedgedoc/hedgedoc:1.9.8
artifacthub.io/changes: |
- kind: security
description: "Update to HedgeDoc 1.9.9, see [GitHub](https://github.com/hedgedoc/hedgedoc/releases/tag/1.9.9) for the release notes."
links:
- name: CVE-2023-38487 / GHSA-7494-7hcf-vxpg
url: https://github.com/hedgedoc/hedgedoc/security/advisories/GHSA-7494-7hcf-vxpg
- kind: added
description: Allow creating a ServiceMonitor resource
9 changes: 8 additions & 1 deletion charts/hedgedoc/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions charts/hedgedoc/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{- if and .Values.prometheus.enabled .Values.prometheus.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "hedgedoc.fullname" . }}
labels:
{{- include "hedgedoc.labels" . | nindent 4 }}
{{- if .Values.prometheus.extraLabels }}
{{- .Values.prometheus.extraLabels | toYaml | nindent 4 }}
{{- end }}
{{- if .Values.prometheus.extraAnnotations }}
annotations:
{{- .Values.prometheus.extraAnnotations | toYaml | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
{{- include "hedgedoc.selectorLabels" . | nindent 6 }}
endpoints:
- port: http
{{- if .Values.prometheus.serviceMonitor.interval }}
interval: {{ .Values.prometheus.serviceMonitor.interval }}
{{- end }}
path: "/metrics"
{{- if .Values.prometheus.serviceMonitor.metricRelabelings }}
metricRelabelings:
{{- toYaml .Values.prometheus.serviceMonitor.metricRelabelings | nindent 6 }}
{{- end }}
{{- if .Values.prometheus.serviceMonitor.relabelings }}
relabelings:
{{- toYaml .Values.prometheus.serviceMonitor.relabelings | nindent 6 }}
{{- end }}
{{- end }}
18 changes: 18 additions & 0 deletions charts/hedgedoc/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -277,3 +277,21 @@ extraSecretMounts: {}
# --from-literal=CMD_DB_PASSWORD=rickastley \
# --from-literal=CMD_SESSION_SECRET=verysecure
existingSecret: ~

# Configure how Hedgedoc is to be monitored using Prometheus
prometheus:
# -- Enable Prometheus integration
enabled: false
# -- Labels to add to all Prometheus integration resources
extraLabels: {}
# -- Annotations to add to all Prometheus integration resources
extraAnnotations: {}
serviceMonitor:
# -- Enable creation of a ServiceMonitor CRD
enabled: false
# -- Interval at which metrics should be scraped
interval: "30s"
# -- MetricRelabelConfigs to apply to samples before ingestion
metricRelabelings: []
# -- RelabelConfigs to apply to samples before scraping
relabelings: []

0 comments on commit 5b01fd2

Please sign in to comment.