From d2ad20651fb0624c2e3299acabf0b3ee81bb569a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Wed, 17 Jun 2020 22:55:03 +0200 Subject: [PATCH] Adding Prometheus support in K8S This adds an annotation in the back container that will allow the Prometheus to autodetect containers in the cluster. --- deeployer.libsonnet | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/deeployer.libsonnet b/deeployer.libsonnet index cb8cf50a..975686be 100644 --- a/deeployer.libsonnet +++ b/deeployer.libsonnet @@ -42,6 +42,23 @@ "config": { "https": { "mail": "d.negrier@thecodingmachine.com" - } + }, + k8sextension(k8sConf):: + k8sConf + { + back+: { + deployment+: { + spec+: { + template+: { + metadata+: { + annotations+: { + "prometheus.io/port": "8080", + "prometheus.io/scrape": "true" + } + } + } + } + } + } + } } }