Skip to content

Commit

Permalink
feat: template mongors exporter too.
Browse files Browse the repository at this point in the history
  • Loading branch information
robinbourianes-kalisio committed Dec 8, 2020
1 parent f0e7e3b commit efe77bf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ services:
memory: 128M
reservations:
memory: 64M
placement:
constraints:
- node.labels.mongodb == true
networks:
- kargo-back-network

networks:
kargo-back-network:
name: ${DOCKER_BACK_NETWORK}
external: true
external: true
23 changes: 7 additions & 16 deletions deploy/prometheus-mongors.yml → deploy/mongors-exporter.yml.tpl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
version: '3.5'

services:
mongodb0-exporter:
${MONGORS_NAME}0-exporter:
image: ${PROMETHEUS_MONGODB_EXPORTER_IMAGE}:${PROMETHEUS_MONGODB_EXPORTER_TAG}
command:
- '--mongodb.uri=mongodb://mongodb0'
- '--mongodb.uri=mongodb://${MONGORS_NAME}0'
- '--collect.collection'
deploy:
replicas: 1
Expand All @@ -13,16 +13,13 @@ services:
memory: 128M
reservations:
memory: 64M
placement:
constraints:
- node.labels.mongodb0 == true
networks:
- kargo-back-network

mongodb1-exporter:
${MONGORS_NAME}1-exporter:
image: ${PROMETHEUS_MONGODB_EXPORTER_IMAGE}:${PROMETHEUS_MONGODB_EXPORTER_TAG}
command:
- '--mongodb.uri=mongodb://mongodb1'
- '--mongodb.uri=mongodb://${MONGORS_NAME}1'
- '--collect.collection'
deploy:
replicas: 1
Expand All @@ -31,16 +28,13 @@ services:
memory: 128M
reservations:
memory: 64M
placement:
constraints:
- node.labels.mongodb1 == true
networks:
- kargo-back-network

mongodb2-exporter:
${MONGORS_NAME}2-exporter:
image: ${PROMETHEUS_MONGODB_EXPORTER_IMAGE}:${PROMETHEUS_MONGODB_EXPORTER_TAG}
command:
- '--mongodb.uri=mongodb://mongodb2'
- '--mongodb.uri=mongodb://${MONGORS_NAME}2'
- '--collect.collection'
deploy:
replicas: 1
Expand All @@ -49,13 +43,10 @@ services:
memory: 128M
reservations:
memory: 64M
placement:
constraints:
- node.labels.mongodb2 == true
networks:
- kargo-back-network

networks:
kargo-back-network:
name: ${DOCKER_BACK_NETWORK}
external: true
external: true
3 changes: 3 additions & 0 deletions deploy/mongors-exporter_before.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

envsubst '${MONGORS_NAME}' < deploy/mongors-exporter.yml.tpl > deploy/mongors-exporter.yml

0 comments on commit efe77bf

Please sign in to comment.