From 818b26c642dc6c0e34787210a9a21a0a26a1c058 Mon Sep 17 00:00:00 2001 From: WrenIX Date: Thu, 27 Feb 2025 13:29:37 +0100 Subject: [PATCH] fix(alertmanager-matrix): add global (and improve docs) --- alertmanager-matrix/Chart.yaml | 2 +- alertmanager-matrix/README.adoc | 366 ------------------ alertmanager-matrix/README.md | 16 +- alertmanager-matrix/templates/deployment.yaml | 6 +- alertmanager-matrix/values.yaml | 20 +- 5 files changed, 28 insertions(+), 382 deletions(-) delete mode 100644 alertmanager-matrix/README.adoc diff --git a/alertmanager-matrix/Chart.yaml b/alertmanager-matrix/Chart.yaml index 2195783..5d290cc 100644 --- a/alertmanager-matrix/Chart.yaml +++ b/alertmanager-matrix/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: alertmanager-matrix description: Service for managing and receiving Alertmanager alerts on Matrix type: application -version: "0.1.11" +version: "0.1.12" # renovate: image=docker.io/silkeh/alertmanager_matrix appVersion: "0.5.0" maintainers: diff --git a/alertmanager-matrix/README.adoc b/alertmanager-matrix/README.adoc deleted file mode 100644 index 55dd37b..0000000 --- a/alertmanager-matrix/README.adoc +++ /dev/null @@ -1,366 +0,0 @@ - - -= alertmanager-matrix - -image::https://img.shields.io/badge/Version-0.1.11-informational?style=flat-square[Version: 0.1.11] -image::https://img.shields.io/badge/Version-application-informational?style=flat-square[Type: application] -image::https://img.shields.io/badge/AppVersion-0.5.0-informational?style=flat-square[AppVersion: 0.5.0] -== Maintainers - -.Maintainers -|=== -| Name | Email | Url - -| WrenIX -| -| -|=== - -== Usage - -Helm must be installed and setup to your kubernetes cluster to use the charts. -Refer to Helm's https://helm.sh/docs[documentation] to get started. -Once Helm has been set up correctly, fetch the charts as follows: - -[source,bash] ----- -helm pull oci://codeberg.org/wrenix/helm-charts/alertmanager-matrix ----- - -You can install a chart release using the following command: - -[source,bash] ----- -helm install alertmanager-matrix-release oci://codeberg.org/wrenix/helm-charts/alertmanager-matrix --values values.yaml ----- - -To uninstall a chart release use `helm`'s delete command: - -[source,bash] ----- -helm uninstall alertmanager-matrix-release ----- - -== Values - -.Values -|=== -| Key | Type | Default | Description - -| affinity -| object -| `{}` -| - -| autoscaling.enabled -| bool -| `false` -| - -| autoscaling.maxReplicas -| int -| `100` -| - -| autoscaling.minReplicas -| int -| `1` -| - -| autoscaling.targetCPUUtilizationPercentage -| int -| `80` -| - -| bot.alertmanager -| string -| `"http://localhost:9093"` -| - -| bot.colors.alert -| string -| `"black"` -| - -| bot.colors.critical -| string -| `"red"` -| - -| bot.colors.error -| string -| `"red"` -| - -| bot.colors.info -| string -| `"blue"` -| - -| bot.colors.information -| string -| `"blue"` -| - -| bot.colors.resolved -| string -| `"green"` -| - -| bot.colors.silenced -| string -| `"gray"` -| - -| bot.colors.warning -| string -| `"orange"` -| - -| bot.icons.alert -| string -| `"🔔ī¸"` -| - -| bot.icons.critical -| string -| `"🚨"` -| - -| bot.icons.error -| string -| `"🚨"` -| - -| bot.icons.info -| string -| `"ℹī¸"` -| - -| bot.icons.information -| string -| `"ℹī¸"` -| - -| bot.icons.resolved -| string -| `"✅"` -| - -| bot.icons.silenced -| string -| `"🔕"` -| - -| bot.icons.warning -| string -| `"⚠ī¸"` -| - -| bot.matrix.homeserver -| string -| `"http://localhost:8008"` -| - -| bot.matrix.rooms[0] -| string -| `"!not_existing:matrix.org"` -| - -| bot.matrix.rooms[1] -| string -| `"!also_not_existing:matrix.org"` -| - -| bot.matrix.token -| string -| `"SECRET_TOKEN"` -| - -| bot.matrix.userID -| string -| `"bot"` -| - -| bot.messageType -| string -| `"m.notice"` -| - -| bot.showLabels -| bool -| `false` -| - -| bot.template.html -| string -| `"{{ range .Alerts }}\n \n {{.StatusString|icon}}\n {{.StatusString|upper}}\n {{.AlertName}}:\n \n {{.Summary}}\n {{if ne .Fingerprint \"\"}}\n ({{.Fingerprint}})\n {{end}}\n {{if $.ShowLabels}}\n
\n Labels:\n {{.LabelString}}\n {{end}}\n
\n{{- end -}}\n"` -| - -| bot.template.text -| string -| `"{{ range .Alerts }}\n {{- .StatusString|icon}} {{ .StatusString|upper }}{{ .AlertName }}: {{ .Summary }} {{ if ne .Fingerprint \"\" -}}\n ({{.Fingerprint}})\n {{- end}}\n {{- if $.ShowLabels -}}\n , labels:\n {{- .LabelString}}\n {{- end }}\n{{ end -}}\n"` -| - -| fullnameOverride -| string -| `""` -| - -| image.pullPolicy -| string -| `"IfNotPresent"` -| - -| image.registry -| string -| `"registry.gitlab.com"` -| - -| image.repository -| string -| `"wrenix/alertmanager_matrix"` -| - -| image.tag -| string -| `""` -| - -| imagePullSecrets -| list -| `[]` -| - -| ingress.annotations -| object -| `{}` -| - -| ingress.className -| string -| `""` -| - -| ingress.enabled -| bool -| `false` -| - -| ingress.hosts[0].host -| string -| `"chart-example.local"` -| - -| ingress.hosts[0].paths[0].path -| string -| `"/"` -| - -| ingress.hosts[0].paths[0].pathType -| string -| `"ImplementationSpecific"` -| - -| ingress.tls -| list -| `[]` -| - -| logging.additionalFilters -| list -| `[]` -| Add other filters to Flow - -| logging.dedot -| string -| `nil` -| if an filter (here or global) for dedot is active - for disable set `null` - -| logging.enabled -| bool -| `false` -| Deploy Flow for logging-operator - -| logging.globalOutputRefs -| list -| `["default"]` -| Flows globalOutputRefs for use of ClusterOutputs - -| logging.localOutputRefs -| list -| `[]` -| Flows localOutputRefs for use of Outputs - -| nameOverride -| string -| `""` -| - -| nodeSelector -| object -| `{}` -| - -| podAnnotations -| object -| `{}` -| - -| podLabels -| object -| `{}` -| - -| podSecurityContext -| object -| `{}` -| - -| replicaCount -| int -| `1` -| - -| resources -| object -| `{}` -| - -| securityContext -| object -| `{}` -| - -| service.port -| int -| `4051` -| - -| service.type -| string -| `"ClusterIP"` -| - -| serviceAccount.annotations -| object -| `{}` -| - -| serviceAccount.create -| bool -| `true` -| - -| serviceAccount.name -| string -| `""` -| - -| tolerations -| list -| `[]` -| -|=== - -Autogenerated from chart metadata using https://github.com/norwoodj/helm-docs[helm-docs] diff --git a/alertmanager-matrix/README.md b/alertmanager-matrix/README.md index ddb4ed3..004a83e 100644 --- a/alertmanager-matrix/README.md +++ b/alertmanager-matrix/README.md @@ -7,7 +7,7 @@ description: "Service for managing and receiving Alertmanager alerts on Matrix" # alertmanager-matrix -![Version: 0.1.11](https://img.shields.io/badge/Version-0.1.11-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.5.0](https://img.shields.io/badge/AppVersion-0.5.0-informational?style=flat-square) +![Version: 0.1.12](https://img.shields.io/badge/Version-0.1.12-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.5.0](https://img.shields.io/badge/AppVersion-0.5.0-informational?style=flat-square) Service for managing and receiving Alertmanager alerts on Matrix @@ -72,13 +72,15 @@ helm uninstall alertmanager-matrix-release | bot.matrix.userID | string | `"bot"` | | | bot.messageType | string | `"m.notice"` | | | bot.showLabels | bool | `false` | | -| bot.template.html | string | `"{{ range .Alerts }}\n \n {{.StatusString|icon}}\n {{.StatusString|upper}}\n {{.AlertName}}:\n \n {{.Summary}}\n {{if ne .Fingerprint \"\"}}\n ({{.Fingerprint}})\n {{end}}\n {{if $.ShowLabels}}\n
\n Labels:\n {{.LabelString}}\n {{end}}\n
\n{{- end -}}\n"` | | +| bot.template.html | string | `"{{ range .Alerts }}\n \n {{.StatusString|icon}}\n {{.StatusString|upper}}\n {{.AlertName}}:\n \n {{.Summary}}\n {{if ne .Fingerprint \"\"}}\n ({{.Fingerprint}})\n {{end}}\n {{if $.ShowLabels}}\n
\n Labels:\n {{.LabelString}}\n {{end}}\n
\n{{- end -}}\n"` | | | bot.template.text | string | `"{{ range .Alerts }}\n {{- .StatusString|icon}} {{ .StatusString|upper }}{{ .AlertName }}: {{ .Summary }} {{ if ne .Fingerprint \"\" -}}\n ({{.Fingerprint}})\n {{- end}}\n {{- if $.ShowLabels -}}\n , labels:\n {{- .LabelString}}\n {{- end }}\n{{ end -}}\n"` | | | fullnameOverride | string | `""` | | -| image.pullPolicy | string | `"IfNotPresent"` | | -| image.registry | string | `"registry.gitlab.com"` | | -| image.repository | string | `"wrenix/alertmanager_matrix"` | | -| image.tag | string | `""` | | +| global.image.pullPolicy | string | `nil` | if set it will overwrite all pullPolicy | +| global.image.registry | string | `nil` | if set it will overwrite all registry entries | +| image.pullPolicy | string | `"IfNotPresent"` | This sets the pull policy for images. (could be overwritten by global.image.pullPolicy) | +| image.registry | string | `"registry.gitlab.com"` | image registry (could be overwritten by global.image.registry) | +| image.repository | string | `"wrenix/alertmanager_matrix"` | image repository | +| image.tag | string | `""` | image tag - Overrides the image tag whose default is the chart appVersion. latest with current: - amd64 @sha256:2afd6d70f39fdfa98f11758090506f7845aee33cc8d900f9fe39a2574c272063 - 386 /x86 @sha256:beca95e9595de7169ab34406936b585d6676ce03a7fe51815b3a6a4944f9dd6d - arm v6 @sha256:ce40ea204497bfc9b2e796cf984eba53ba7c59164d39dcd4c11f0ca561e57eca - arm v7 @sha256:59ce3dfc73be5f70b873fe095e1eee4e0fe1f256b39f8f051ad0a2ffe9d1177e - arm v8 @sha256:fdbf50e944f8118dd1a44dde21b9cc098fb13837031e2f2492c148848c3d3cc8 - ppc64le @sha256:4ce02adbf4efe3ad04422e35bd4e87442a7c899fea13988adaeb985c720e0c63 - s390x @sha256:a202252cc00664a17caa5760f749b35a7b71253d1b1474b861f233e83ada1c76 | | imagePullSecrets | list | `[]` | | | ingress.annotations | object | `{}` | | | ingress.className | string | `""` | | @@ -97,7 +99,7 @@ helm uninstall alertmanager-matrix-release | podAnnotations | object | `{}` | | | podLabels | object | `{}` | | | podSecurityContext | object | `{}` | | -| replicaCount | int | `1` | | +| replicaCount | int | `1` | replicas | | resources | object | `{}` | | | securityContext | object | `{}` | | | service.port | int | `4051` | | diff --git a/alertmanager-matrix/templates/deployment.yaml b/alertmanager-matrix/templates/deployment.yaml index e8e389e..2b94fa6 100644 --- a/alertmanager-matrix/templates/deployment.yaml +++ b/alertmanager-matrix/templates/deployment.yaml @@ -37,8 +37,10 @@ spec: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- with .Values.image }} + image: "{{ coalesce $.Values.global.image.registry .registry }}/{{ .repository }}:{{ .tag | default $.Chart.AppVersion }}" + imagePullPolicy: {{ coalesce $.Values.global.image.pullPolicy .pullPolicy }} + {{- end }} command: - "/usr/local/bin/alertmanager_matrix" {{- if .Values.bot.showLabels }} diff --git a/alertmanager-matrix/values.yaml b/alertmanager-matrix/values.yaml index e2e14ab..1401264 100644 --- a/alertmanager-matrix/values.yaml +++ b/alertmanager-matrix/values.yaml @@ -1,14 +1,22 @@ -# Default values for alertmanager-matrix. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. +global: + image: + # -- if set it will overwrite all registry entries + registry: + # -- if set it will overwrite all pullPolicy + pullPolicy: + +# -- replicas replicaCount: 1 image: + # -- image registry (could be overwritten by global.image.registry) registry: registry.gitlab.com + # -- image repository repository: wrenix/alertmanager_matrix + # -- This sets the pull policy for images. (could be overwritten by global.image.pullPolicy) pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. + # -- image tag - Overrides the image tag whose default is the chart appVersion. # latest with current: # - amd64 @sha256:2afd6d70f39fdfa98f11758090506f7845aee33cc8d900f9fe39a2574c272063 # - 386 /x86 @sha256:beca95e9595de7169ab34406936b585d6676ce03a7fe51815b3a6a4944f9dd6d @@ -79,8 +87,8 @@ bot:
Labels: {{.LabelString}} - {{end}} -
+ {{end}} +
{{- end -}} serviceAccount: