From a7e3c80ae67c211c008315331aeb252ace65d404 Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Fri, 8 Oct 2021 11:59:18 +0200 Subject: [PATCH] Add prometheus-msteams image This can be used to forward Prometheus Alertmanager notifications to Microsoft Teams. Change-Id: I57ebdf734c4bf38045ca8f837dc7066cdeb16131 --- .../prometheus-msteams/Dockerfile.j2 | 24 +++++++++++++++++++ kolla/image/build.py | 1 + .../prometheus-msteams-27e7f23e29f208b4.yaml | 5 ++++ 3 files changed, 30 insertions(+) create mode 100644 docker/prometheus/prometheus-msteams/Dockerfile.j2 create mode 100644 releasenotes/notes/prometheus-msteams-27e7f23e29f208b4.yaml diff --git a/docker/prometheus/prometheus-msteams/Dockerfile.j2 b/docker/prometheus/prometheus-msteams/Dockerfile.j2 new file mode 100644 index 0000000000..6222dab399 --- /dev/null +++ b/docker/prometheus/prometheus-msteams/Dockerfile.j2 @@ -0,0 +1,24 @@ +FROM {{ namespace }}/{{ infra_image_prefix }}prometheus-base:{{ tag }} +{% block labels %} +LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}" +{% endblock %} + +{% block prometheus_msteams_header %}{% endblock %} + +{% block prometheus_msteams_repository_version %} +ARG prometheus_msteams_version=1.5.0 +ARG prometheus_msteams_sha256sum=74d1bedb12f6ec09fb65ddeb63328f691a9b2a56c92d7682ca152c867fc7c7a0 +{% endblock %} + +{% block prometheus_msteams_install %} +RUN curl -o /tmp/prometheus-msteams https://github.com/prometheus-msteams/prometheus-msteams/releases/download/v${prometheus_msteams_version}/prometheus-msteams-linux-{{debian_arch}} \ + && echo "${prometheus_msteams_sha256sum} /tmp/prometheus-msteams" | sha256sum -c \ + && mv /tmp/prometheus-msteams /opt \ + && chmod 0755 /opt/prometheus-msteams \ + && mkdir -p /etc/msteams +{% endblock %} + +{% block prometheus_msteams_footer %}{% endblock %} +{% block footer %}{% endblock %} + +USER prometheus diff --git a/kolla/image/build.py b/kolla/image/build.py index a868726757..66925d92a2 100755 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -81,6 +81,7 @@ LOG = utils.make_a_logger() UNBUILDABLE_IMAGES = { 'aarch64': { "bifrost-base", # someone need to get upstream working first + "prometheus-msteams", # no aarch64 binary "prometheus-mtail", # no aarch64 binary "skydive-base", # no aarch64 binary }, diff --git a/releasenotes/notes/prometheus-msteams-27e7f23e29f208b4.yaml b/releasenotes/notes/prometheus-msteams-27e7f23e29f208b4.yaml new file mode 100644 index 0000000000..475d1d7dad --- /dev/null +++ b/releasenotes/notes/prometheus-msteams-27e7f23e29f208b4.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Adds ``prometheus-msteams`` image, which can be used to forward Prometheus + Alertmanager notifications to Microsoft Teams.