83 lines
1.8 KiB
YAML
83 lines
1.8 KiB
YAML
---
|
|
|
|
# Name of the instance
|
|
instance: mongodb
|
|
|
|
# Vault settings for the PKI
|
|
vault:
|
|
pki:
|
|
ou: MongoDB
|
|
|
|
mongo:
|
|
|
|
# Docker image to use
|
|
image: '[[ .docker.repo ]][[ .docker.base_images.mongo70.image ]]'
|
|
|
|
# Number of instances to run
|
|
count: 3
|
|
|
|
# Custom env var to set in the containers
|
|
env: {}
|
|
|
|
# Resource allocation for each mongo node
|
|
resources:
|
|
cpu: 200
|
|
memory: 768
|
|
|
|
# Vault settings
|
|
vault:
|
|
# List of policies to attach to the containers
|
|
policies:
|
|
- '[[ .instance ]]-mongod[[ .consul.suffix ]]'
|
|
|
|
# Random secrets to generate
|
|
rand_secrets:
|
|
fields:
|
|
- root_pwd
|
|
|
|
consul:
|
|
# Service metadata to publish in the consul catalog
|
|
meta:
|
|
addr: 'mongo-${NOMAD_ALLOC_INDEX}.[[ .instance ]][[ .consul.suffix ]].service.[[ .consul.domain ]]'
|
|
check:
|
|
interval: 2m
|
|
|
|
nomad:
|
|
constraints:
|
|
- operator: distinct_hosts
|
|
value: true
|
|
|
|
# If port is set, a static port will be allocated. Else, a dynamic port will be used
|
|
# port: 27017
|
|
|
|
# Custom mongod.conf fragment which will be merged with the default one
|
|
# Can be either a yaml object or a string (if using consul-template is needed)
|
|
config: {}
|
|
|
|
# Volume for data persistence
|
|
volumes:
|
|
mongo:
|
|
source: mongo-data
|
|
type: csi
|
|
per_alloc: true
|
|
|
|
# Name of the replica set
|
|
replica_set: rs0
|
|
|
|
# Prometheus exporter
|
|
exporter:
|
|
version: 0.40.0
|
|
image: percona/mongodb_exporter:[[ .mongo.exporter.version ]]
|
|
vault:
|
|
policies:
|
|
- '[[ .instance ]]-mongod[[ .consul.suffix ]]'
|
|
- metrics[[ .consul.suffix ]]
|
|
resources:
|
|
cpu: 10
|
|
memory: 50
|
|
|
|
prometheus:
|
|
enabled: '[[ .prometheus.available ]]'
|
|
# URL where prometheus metrics are exposed (from inside the container PoV)
|
|
metrics_url: http://127.0.0.1:9216/metrics
|