Fixes 1436 - docker/tests/Dockerfile: cryptography dependencies
[osm/devops.git] / installers / docker / osm_pods / prometheus.yaml
index b6ab986..93cd20a 100644 (file)
@@ -81,6 +81,16 @@ spec:
       labels:
         app: prometheus
     spec:
+      initContainers:
+      - name: prometheus-init-config
+        image: busybox
+        command: ["/bin/sh", "-c"]
+        args: ['if [ ! -f "/etc/prometheus/prometheus.yml" ]; then cp /etc/prometheus_init/prometheus.yml /etc/prometheus; fi']
+        volumeMounts:
+          - name: prom-config
+            mountPath: /etc/prometheus
+          - name: init-prom-config
+            mountPath: /etc/prometheus_init
       containers:
       - name: prometheus
         image: prom/prometheus:v2.4.3
@@ -92,13 +102,15 @@ 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
+      - name: init-prom-config
+        configMap:
+          name: prom