# A scrape configuration containing exactly one endpoint to scrape:
# 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: 'mon_exporter'
-
- # metrics_path defaults to '/metrics'
- # scheme defaults to 'http'.
-
static_configs:
- targets: ['mon:8000']
+ # Add here other external targets, e.g. a pushgateway
+ # - job_name: 'pushgateway'
+ # static_configs:
+ # - targets: ['prometheus-pushgateway:9091']
kind: ConfigMap
metadata:
name: prom
- 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']
+ args: ['if [ ! -f "/etc/prometheus/prometheus.yml" ]; then cp /config/prometheus.yml /etc/prometheus; fi']
volumeMounts:
- name: prom-config
mountPath: /etc/prometheus
- - name: init-prom-config
- mountPath: /etc/prometheus_init
+ - name: prom-config-base
+ mountPath: /config
containers:
- name: prometheus
image: prom/prometheus:v2.28.1
- name: prom-db
mountPath: /prometheus
- name: prometheus-config-sidecar
- image: opensourcemano/prometheus:11
+ image: opensourcemano/prometheus:13
env:
- name: MONGODB_URL
value: mongodb://mongodb-k8s:27017/?replicaSet=rs0
- name: PROMETHEUS_CONFIG_FILE
value: /etc/prometheus/prometheus.yml
+ - name: PROMETHEUS_BASE_CONFIG_FILE
+ value: /etc/prometheus_base/prometheus.yml
- name: TARGET_DATABASE
value: osm
- name: PROMETHEUS_URL
volumeMounts:
- name: prom-config
mountPath: /etc/prometheus
+ - name: prom-config-base
+ mountPath: /etc/prometheus_base
volumes:
- - emptyDir: {}
- name: prom-db
+ - name: prom-db
+ emptyDir: {}
- name: prom-config
emptyDir: {}
- - name: init-prom-config
+ - name: prom-config-base
configMap:
name: prom