From 6ba0591ce123f669d7c8d22a0d7df72ca5a0c0c3 Mon Sep 17 00:00:00 2001 From: bravof Date: Wed, 1 Jul 2020 15:11:57 -0400 Subject: [PATCH] feat(lcm-prometheus interconnection): allows lcm to modify prometheus config in order to push new jobs like snmp metrics recollection Change-Id: I8ea564f9d6ae96d6a5042e691ccaa0c758add158 Signed-off-by: bravof (cherry picked from commit 1e0297e98ab41e4bdc9537c1adffc2cae8b198cb) --- installers/docker/osm_pods/lcm.yaml | 5 +++++ installers/docker/osm_pods/prometheus.yaml | 17 ++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/installers/docker/osm_pods/lcm.yaml b/installers/docker/osm_pods/lcm.yaml index 0801b826..6858f2a8 100644 --- a/installers/docker/osm_pods/lcm.yaml +++ b/installers/docker/osm_pods/lcm.yaml @@ -50,7 +50,12 @@ spec: volumeMounts: - name: osm-packages mountPath: /app/storage + - name: prometheus-config + mountPath: /etc/prometheus volumes: - name: osm-packages hostPath: path: /var/lib/osm/osm_osm_packages/_data + - name: prometheus-config + hostPath: + path: /var/lib/osm/prometheus diff --git a/installers/docker/osm_pods/prometheus.yaml b/installers/docker/osm_pods/prometheus.yaml index b6ab986c..f7fd5698 100644 --- a/installers/docker/osm_pods/prometheus.yaml +++ b/installers/docker/osm_pods/prometheus.yaml @@ -81,6 +81,14 @@ spec: labels: app: prometheus spec: + initContainers: + - name: prometheus-init-config + image: busybox + command: ["/bin/sh", "-c"] + args: ["printf \"global:\\n scrape_interval: 15s\\n evaluation_interval: 15s\\nscrape_configs:\\n - job_name: 'prometheus'\\n static_configs:\\n - targets: ['mon:8000']\" > /etc/prometheus/prometheus.yml"] + volumeMounts: + - name: prom-config + mountPath: /etc/prometheus containers: - name: prometheus image: prom/prometheus:v2.4.3 @@ -92,13 +100,12 @@ spec: protocol: TCP volumeMounts: - name: prom-config - mountPath: /etc/prometheus/ + mountPath: /etc/prometheus - name: prom-db mountPath: /prometheus volumes: - - configMap: - defaultMode: 420 - name: prom - name: prom-config - emptyDir: {} name: prom-db + - name: prom-config + hostPath: + path: /var/lib/osm/prometheus -- 2.17.1