fix(alertmanager-matrix): add flow for logging operator
This commit is contained in:
parent
b8589f83e7
commit
35b90df760
6 changed files with 85 additions and 15 deletions
|
@ -2,7 +2,7 @@ apiVersion: v2
|
||||||
name: alertmanager-matrix
|
name: alertmanager-matrix
|
||||||
description: Service for managing and receiving Alertmanager alerts on Matrix
|
description: Service for managing and receiving Alertmanager alerts on Matrix
|
||||||
type: application
|
type: application
|
||||||
version: 0.1.3
|
version: 0.1.4
|
||||||
appVersion: "latest"
|
appVersion: "latest"
|
||||||
keywords:
|
keywords:
|
||||||
- matrix
|
- matrix
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# alertmanager-matrix
|
# alertmanager-matrix
|
||||||
|
|
||||||
  
|
  
|
||||||
|
|
||||||
Service for managing and receiving Alertmanager alerts on Matrix
|
Service for managing and receiving Alertmanager alerts on Matrix
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ helm uninstall alertmanager-matrix-release
|
||||||
| bot.messageType | string | `"m.notice"` | |
|
| bot.messageType | string | `"m.notice"` | |
|
||||||
| bot.showLabels | bool | `false` | |
|
| bot.showLabels | bool | `false` | |
|
||||||
| bot.template.html | string | `"{{ range .Alerts }}\n <font color=\"{{.StatusString|color}}\">\n {{.StatusString|icon}}\n <b>{{.StatusString|upper}}</b>\n {{.AlertName}}:\n </font>\n {{.Summary}}\n {{if ne .Fingerprint \"\"}}\n ({{.Fingerprint}})\n {{end}}\n {{if $.ShowLabels}}\n <br/>\n <b>Labels:</b>\n <code>{{.LabelString}}</code>\n {{end}}\n <br/>\n{{- end -}}\n"` | |
|
| bot.template.html | string | `"{{ range .Alerts }}\n <font color=\"{{.StatusString|color}}\">\n {{.StatusString|icon}}\n <b>{{.StatusString|upper}}</b>\n {{.AlertName}}:\n </font>\n {{.Summary}}\n {{if ne .Fingerprint \"\"}}\n ({{.Fingerprint}})\n {{end}}\n {{if $.ShowLabels}}\n <br/>\n <b>Labels:</b>\n <code>{{.LabelString}}</code>\n {{end}}\n <br/>\n{{- end -}}\n"` | |
|
||||||
| bot.template.text | string | `"{{ range .Alerts }}\n {{.StatusString|icon}}\n {{.StatusString|upper}}\n {{.AlertName}}:\n {{.Summary}}\n {{if ne .Fingerprint \"\"}}\n ({{.Fingerprint}})\n {{end}}\n {{if $.ShowLabels}}\n , labels:\n {{.LabelString}}\n {{end}}\n \\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 | `""` | |
|
| fullnameOverride | string | `""` | |
|
||||||
| image.pullPolicy | string | `"IfNotPresent"` | |
|
| image.pullPolicy | string | `"IfNotPresent"` | |
|
||||||
| image.registry | string | `"docker.io"` | |
|
| image.registry | string | `"docker.io"` | |
|
||||||
|
@ -74,6 +74,11 @@ helm uninstall alertmanager-matrix-release
|
||||||
| ingress.hosts[0].paths[0].path | string | `"/"` | |
|
| ingress.hosts[0].paths[0].path | string | `"/"` | |
|
||||||
| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | |
|
| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | |
|
||||||
| ingress.tls | list | `[]` | |
|
| 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](https://kube-logging.github.io/docs/) |
|
||||||
|
| logging.globalOutputRefs | list | `["default"]` | Flows globalOutputRefs for use of ClusterOutputs |
|
||||||
|
| logging.localOutputRefs | list | `[]` | Flows localOutputRefs for use of Outputs |
|
||||||
| nameOverride | string | `""` | |
|
| nameOverride | string | `""` | |
|
||||||
| nodeSelector | object | `{}` | |
|
| nodeSelector | object | `{}` | |
|
||||||
| podAnnotations | object | `{}` | |
|
| podAnnotations | object | `{}` | |
|
||||||
|
|
|
@ -50,6 +50,19 @@ app.kubernetes.io/name: {{ include "alertmanager-matrix.name" . }}
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Selector Log labels
|
||||||
|
*/}}
|
||||||
|
{{- define "alertmanager-matrix.selectorLogLabels" -}}
|
||||||
|
{{- if .Values.logging.dedot }}
|
||||||
|
app{{.Values.logging.dedot }}kubernetes{{.Values.logging.dedot }}io/name: {{ include "alertmanager-matrix.name" . }}
|
||||||
|
app{{.Values.logging.dedot }}kubernetes{{.Values.logging.dedot }}io/instance: {{ .Release.Name }}
|
||||||
|
{{- else }}
|
||||||
|
{{ include "alertmanager-matrix.selectorLabels" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Create the name of the service account to use
|
Create the name of the service account to use
|
||||||
*/}}
|
*/}}
|
||||||
|
|
41
alertmanager-matrix/templates/flow.yaml
Normal file
41
alertmanager-matrix/templates/flow.yaml
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
{{- with .Values.logging }}
|
||||||
|
{{- if .enabled }}
|
||||||
|
---
|
||||||
|
apiVersion: logging.banzaicloud.io/v1beta1
|
||||||
|
kind: Flow
|
||||||
|
metadata:
|
||||||
|
name: {{ include "alertmanager-matrix.fullname" $ }}
|
||||||
|
spec:
|
||||||
|
match:
|
||||||
|
- select:
|
||||||
|
labels:
|
||||||
|
{{- include "alertmanager-matrix.selectorLogLabels" $ | nindent 10 }}
|
||||||
|
container_names:
|
||||||
|
- "{{ $.Chart.Name }}"
|
||||||
|
filters:
|
||||||
|
- parser:
|
||||||
|
reserve_data: true
|
||||||
|
remove_key_name_field: true
|
||||||
|
parse:
|
||||||
|
type: "multi_format"
|
||||||
|
patterns:
|
||||||
|
- format: "regexp"
|
||||||
|
expression: '^(?<time>\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2})\s(?<message>.*)'
|
||||||
|
time_key: "time"
|
||||||
|
time_type: "string"
|
||||||
|
time_format: "%Y/%m/%d %H:%M:%S"
|
||||||
|
- format: "none"
|
||||||
|
{{- with .additionalFilters }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .globalOutputRefs }}
|
||||||
|
globalOutputRefs:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .localOutputRefs }}
|
||||||
|
localOutputRefs:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
|
@ -56,18 +56,13 @@ bot:
|
||||||
template:
|
template:
|
||||||
text: >
|
text: >
|
||||||
{{ range .Alerts }}
|
{{ range .Alerts }}
|
||||||
{{.StatusString|icon}}
|
{{- .StatusString|icon}} {{ .StatusString|upper }}{{ .AlertName }}: {{ .Summary }} {{ if ne .Fingerprint "" -}}
|
||||||
{{.StatusString|upper}}
|
|
||||||
{{.AlertName}}:
|
|
||||||
{{.Summary}}
|
|
||||||
{{if ne .Fingerprint ""}}
|
|
||||||
({{.Fingerprint}})
|
({{.Fingerprint}})
|
||||||
{{end}}
|
{{- end}}
|
||||||
{{if $.ShowLabels}}
|
{{- if $.ShowLabels -}}
|
||||||
, labels:
|
, labels:
|
||||||
{{.LabelString}}
|
{{- .LabelString}}
|
||||||
{{end}}
|
{{- end }}
|
||||||
\n
|
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
html: >
|
html: >
|
||||||
{{ range .Alerts }}
|
{{ range .Alerts }}
|
||||||
|
@ -88,6 +83,22 @@ bot:
|
||||||
<br/>
|
<br/>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
# Logging
|
||||||
|
# This Helm chart could also deploy Flow for the logging-operator
|
||||||
|
logging:
|
||||||
|
# -- Deploy Flow for [Logging-Operator](https://kube-logging.github.io/docs/)
|
||||||
|
enabled: false
|
||||||
|
# -- if an filter (here or global) for dedot is active - for disable set `null`
|
||||||
|
dedot:
|
||||||
|
# -- Add other filters to Flow
|
||||||
|
additionalFilters: []
|
||||||
|
# -- Flows localOutputRefs for use of Outputs
|
||||||
|
localOutputRefs: []
|
||||||
|
# -- Flows globalOutputRefs for use of ClusterOutputs
|
||||||
|
globalOutputRefs:
|
||||||
|
- "default"
|
||||||
|
|
||||||
|
|
||||||
serviceAccount:
|
serviceAccount:
|
||||||
# Specifies whether a service account should be created
|
# Specifies whether a service account should be created
|
||||||
create: true
|
create: true
|
||||||
|
|
|
@ -6,7 +6,6 @@ helm-docs -t ./README.md.gotmpl -t _docs.gotmpl
|
||||||
|
|
||||||
for p in * ; do
|
for p in * ; do
|
||||||
if \
|
if \
|
||||||
[ $p == "alertmanager-matrix" ] || \
|
|
||||||
[ $p == "alertmanager-ntfy" ] || \
|
[ $p == "alertmanager-ntfy" ] || \
|
||||||
[ $p == "conduit" ] || \
|
[ $p == "conduit" ] || \
|
||||||
[ $p == "forgejo-runner" ] || \
|
[ $p == "forgejo-runner" ] || \
|
||||||
|
@ -15,6 +14,7 @@ for p in * ; do
|
||||||
[ $p == "hydrogen-web" ] || \
|
[ $p == "hydrogen-web" ] || \
|
||||||
[ $p == "miniserve" ] || \
|
[ $p == "miniserve" ] || \
|
||||||
[ $p == "monitoring" ] || \
|
[ $p == "monitoring" ] || \
|
||||||
|
[ $p == "postgresql" ] || \
|
||||||
[ "1" != "1" ] \
|
[ "1" != "1" ] \
|
||||||
; then
|
; then
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Add table
Reference in a new issue