Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(chart-deps): update prometheus-msteams to version 0.7.1 #1960

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chart/chart-index/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ dependencies:
version: 7.10.0
repository: https://prometheus-community.github.io/helm-charts
- name: prometheus-msteams
version: 0.4.4
version: 0.7.1
repository: https://prometheus-msteams.github.io/prometheus-msteams/
- name: promtail
version: 6.16.6
Expand Down
10 changes: 8 additions & 2 deletions charts/prometheus-msteams/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
apiVersion: v1
appVersion: v1.3.3
appVersion: v1.4.1
description: A Helm chart for Kubernetes
home: https://github.com/prometheus-msteams/prometheus-msteams
maintainers:
- name: bzon
url: https://github.com/bzon
- name: Knappek
url: https://github.com/Knappek
name: prometheus-msteams
version: 0.4.4
version: 0.7.1
50 changes: 28 additions & 22 deletions charts/prometheus-msteams/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<!-- vim-markdown-toc GFM -->

* [Download the chart](#download-the-chart)
* [Prepare the Deployment configuration](#prepare-the-deployment-configuration)
* [Deploy to Kubernetes cluster](#deploy-to-kubernetes-cluster)
* [When using with Prometheus Operator](#when-using-with-prometheus-operator)
* [Customise messages to MS Teams](#customise-messages-to-ms-teams)
* [Helm Configuration](#helm-configuration)
- [Download the chart](#download-the-chart)
- [Prepare the Deployment configuration](#prepare-the-deployment-configuration)
- [Deploy to Kubernetes cluster](#deploy-to-kubernetes-cluster)
- [When using with Prometheus Operator](#when-using-with-prometheus-operator)
- [Customise messages to MS Teams](#customise-messages-to-ms-teams)
- [Helm Configuration](#helm-configuration)

<!-- vim-markdown-toc -->

Expand All @@ -17,7 +17,7 @@
Clone this repository.

```bash
helm repo add prometheus-msteams https://prometheus-msteams.github.io/helm-chart/
helm repo add prometheus-msteams https://prometheus-msteams.github.io/prometheus-msteams/
```

### Prepare the Deployment configuration
Expand All @@ -30,10 +30,13 @@ Create a helm values file to configure your Microsoft Teams channel connectors a
replicaCount: 1
image:
repository: quay.io/prometheusmsteams/prometheus-msteams
tag: v1.3.3
tag: v1.4.1

connectors:
- high_priority_channel: https://outlook.office.com/webhook/xxxx/xxxx
- low_priority_channel: https://outlook.office.com/webhook/xxxx/xxxx
# in alertmanager, this will be used as http://prometheus-msteams:2000/bar
- bar: https://outlook.office.com/webhook/xxxx/xxxx
# in alertmanager, this will be used as http://prometheus-msteams:2000/foo
- foo: https://outlook.office.com/webhook/xxxx/xxxx

# extraEnvs is useful for adding extra environment variables such as proxy settings
extraEnvs:
Expand All @@ -60,7 +63,7 @@ See [Helm Configuration](#helm-configuration) and [App Configuration](https://gi
```bash
helm upgrade --install prometheus-msteams \
--namespace default -f config.yaml
charts/prometheus-msteams
prometheus-msteams/prometheus-msteams
```

### When using with Prometheus Operator
Expand All @@ -69,16 +72,16 @@ Please see [Prometheus Operator alerting docs](https://github.com/coreos/prometh

### Customise messages to MS Teams

This application uses a [Default Teams Message Card Template](./prometheus-msteams/card.tmpl) to convert incoming Prometheus alerts to teams message cards.
This template can be customised by specifying the value of `customCardTemplate` parameter.
This application uses a [Default Teams Message Card Template](./prometheus-msteams/card.tmpl) to convert incoming Prometheus alerts to teams message cards.
This template can be customised by specifying the value of `customCardTemplate` parameter.
Simply create a new file that you want to use as your custom template (for example, `custom-card.tmpl`).
You can use the `--set-file` flag to set the value from this file:

```bash
helm install --name prometheus-msteams \
./prometheus-msteams --namespace monitoring \
helm upgrade --install prometheus-msteams \
--namespace default -f config.yaml \
--set-file customCardTemplate=custom-card.tmpl \
-f config.yaml
prometheus-msteams/prometheus-msteams
```

Otherwise you can also set the value by specifying the template data directly via values file.
Expand All @@ -87,22 +90,25 @@ Otherwise you can also set the value by specifying the template data directly vi
### Helm Configuration

| Parameter | Description | Default |
| --- | --- | --- |
| `image.repository` | Image repository | `quay.io/prometheusmsteams/prometheus-msteams` |
| `image.tag` | Image tag | `v1.3.3` |
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
| `image.repository` | Image repository | `quay.io/prometheusmsteams/prometheus-msteams` |
| `image.tag` | Image tag | `v1.4.1` |
| `image.pullPolicy` | Image pull policy | `Always` |
| `imagePullSecrets` | Configuration for [imagePullSecrets](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/#create-a-pod-that-uses-your-secret) so that you can use a private registry for your image | `[]` |
| `extraEnvs` | Extra environment variables | `{}` |
| `connectors` | Add your own Microsoft Teams connectors. | `{}` |
| `connectors_with_custom_templates` | Add your own Microsoft Teams connectors with custom template file. | `{}` |
| `connectors` | Add your own Microsoft Teams connectors. | `[]` |
| `connectors_with_custom_templates` | Add your own Microsoft Teams connectors with custom template file. | `[]` |
| `service.port` | Service port | `2000` |
| `service.type` | Service type | `ClusterIP` |
| `container.port` | Container port | `2000` |
| `container.additionalArgs` | additional prometheus-msteams flags to use | `{}` |
| `resources` | Pod resources | See [default](./prometheus-msteams/values.yaml) |
| `resources` | Pod resources | See [default](./values.yaml) |
| `nodeSelector` | Pod nodeSelector | `{}` |
| `affinity` | Pod affinity | `{}` |
| `tolerations` | Pod tolerations | `{}` |
| `priorityClassName` | Pod priority class | `""` |
| `podAnnotations` | Pod annotations | `{}` |
| `podSecurityContext` | Pod securityContext | See [default](./values.yaml) |
| `customCardTemplate` | Custom message card template for MS teams | `""` |
| `metrics.serviceMonitor.enabled` | Set this to `true` to create ServiceMonitor for Prometheus operator | `false` |
| `metrics.serviceMonitor.additionalLabels` | Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | `{}` |
Expand Down
14 changes: 10 additions & 4 deletions charts/prometheus-msteams/card.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,29 @@
{{- else -}}808080{{- end -}}",
"summary": "{{- if eq .CommonAnnotations.summary "" -}}
{{- if eq .CommonAnnotations.message "" -}}
{{- .CommonLabels.alertname -}}
{{- if eq .CommonLabels.alertname "" -}}
Prometheus Alert
{{- else -}}
{{- .CommonLabels.alertname -}}
{{- end -}}
{{- else -}}
{{- .CommonAnnotations.message -}}
{{- end -}}
{{- else -}}
{{- .CommonAnnotations.summary -}}
{{- end -}}",
"title": "Prometheus Alert ({{ .Status }})",
"title": "Prometheus Alert ({{ .Status | title }})",
"sections": [ {{$externalUrl := .ExternalURL}}
{{- range $index, $alert := .Alerts }}{{- if $index }},{{- end }}
{
"activityTitle": "[{{ $alert.Annotations.description }}]({{ $externalUrl }})",
"facts": [
{{- range $key, $value := $alert.Annotations }}
{
"name": "{{ $key }}",
"value": "{{ $value }}"
{{- if ne $key "description" -}}
"name": "{{ $key }}",
"value": "{{ $value }}"
{{- end -}}
},
{{- end -}}
{{$c := counter}}{{ range $key, $value := $alert.Labels }}{{if call $c}},{{ end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/prometheus-msteams/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ Return the appropriate apiVersion for deployment.
{{- if semverCompare ">=1.9-0" .Capabilities.KubeVersion.GitVersion -}}
{{- print "apps/v1" -}}
{{- else -}}
{{- print "apps/v1" -}}
{{- print "apps/v1beta2" -}}
{{- end -}}
{{- end -}}
21 changes: 14 additions & 7 deletions charts/prometheus-msteams/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ metadata:
chart: {{ template "app.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.annotations }}
annotations: {{ toYaml .Values.annotations | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
Expand All @@ -21,15 +18,17 @@ spec:
labels:
app: {{ template "app.name" . }}
release: {{ .Release.Name }}
{{- if .Values.podAnnotations }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configMapConfig.yaml") . | sha256sum }}
checksum/msteams-card-templates: {{ include (print $.Template.BasePath "/configMapTemplate.yaml") . | sha256sum }}
{{- if .Values.podAnnotations }}
{{ toYaml .Values.podAnnotations | indent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{ toYaml .Values.imagePullSecrets | indent 8 }}
{{- end}}
volumes:
- name: config-volume
configMap:
Expand Down Expand Up @@ -57,6 +56,7 @@ spec:
{{- with .Values.container.additionalArgs }}
{{ toYaml . | indent 12 }}
{{- end}}
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.container.port }}
Expand All @@ -75,6 +75,10 @@ spec:
periodSeconds: 20
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.podSecurityContext }}
securityContext:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
Expand All @@ -87,3 +91,6 @@ spec:
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}
20 changes: 12 additions & 8 deletions charts/prometheus-msteams/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ replicaCount: 1

image:
repository: quay.io/prometheusmsteams/prometheus-msteams
tag: v1.3.3
tag: v1.4.1
pullPolicy: Always

imagePullSecrets: []

extraEnvs:

container:
Expand All @@ -30,21 +32,23 @@ tolerations: []

affinity: {}

podSecurityContext:
runAsUser: 1000
runAsNonRoot: true

priorityClassName: ""

metrics:
serviceMonitor:
enabled: false
additionalLabels: {}
scrapeInterval: 30s

connectors: {}
connectors_with_custom_templates: {}

connectors: []
connectors_with_custom_templates: []

## Specify the custom message card template for MS teams
# customCardTemplate: |
# {{ define "teams.card" }}
# {
#
# }
# {...}
# {{ end }}