feat(lcm-prometheus interconnection): allows lcm to modify prometheus config in order...
[osm/devops.git] / installers / docker / osm_pods / prometheus.yaml
index cdfd94d..f7fd569 100644 (file)
@@ -53,7 +53,7 @@ data:
     # Here it's Prometheus itself.
     scrape_configs:
       # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
-      - job_name: 'prometheus'
+      - job_name: 'mon_exporter'
 
         # metrics_path defaults to '/metrics'
         # scheme defaults to 'http'.
@@ -81,21 +81,31 @@ 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
+        args:
+        - --config.file=/etc/prometheus/prometheus.yml
+        - --web.enable-lifecycle
         ports:
         - containerPort: 9090
           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