An example repository demonstrating how to use Ministack.
- Nomad Cluster: With 3 servers, monitoring client, worker client
- Monitoring: Prometheus, complete Thanos implementation, Grafana
name: 'europe'
datacenter: 'europe-paris'
plugins:
# nomad service dns
- 'plugins/coredns.yaml'
# simulate external loadbalancer
- 'plugins/traefik.yaml'
# simulate external bucket s3
- 'plugins/minio-single.yaml'
# simulate external rds postgres
- 'plugins/postgres.yaml'
services:
nomad:
enabled: true
version: '1.9.6'
config:
server:
bootstrap_expect: 3
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.nomad.rule=Host(`nomad.docker.localhost`)'
- 'traefik.http.routers.nomad.entrypoints=web'
- 'traefik.http.services.nomad.loadbalancer.server.port=4646'
servers:
- name: 'nomad-server-1'
- name: 'nomad-server-2'
- name: 'nomad-server-3'
clients:
- name: monitoring-system
local_volumes:
- 'prometheus/rules:/mnt/prometheus/rules'
- 'prometheus/scrape_configs:/mnt/prometheus/scrape_configs'
docker_volumes:
- 'prometheus_data'
- 'thanos_store_data'
- 'thanos_compactor_data'
- name: worker-global- Install ASDF by following their guide.
- Ensure you have the necessary permissions to run shell scripts and install dependencies on your system.
Run the following command to install Ministack:
$ curl -fsSL https://raw.githubusercontent.com/gperreymond/ministack/main/install | bashPrepare your environment by executing the setup script:
$ ./scripts/install-dependencies.shThis will install all ASDF dependencies:
nomad 1.9.6
terraform 1.10.4
terragrunt 0.72.6
jq 1.7.1
mc 2025-02-15T10-36-16Z
To start the cluster, use:
$ ministack --config configurations/servers/cluster.yaml --startTo stop the cluster, use:
$ ministack --config configurations/servers/cluster.yaml --stopNow with this nomad cluster, it's time to deploy some jobs.
# run only once, to create the bucket in minio for terraform states
$ ./scripts/init-minio.sh
# then very classic approach
$ terragrunt init
$ terragrunt apply- scripts/: Contains bash scripts.
- devops/: Contains terraform infra provisionning.
When ministack has started:
- http://traefik.docker.localhost
- http://nomad.docker.localhost
- http://minio-webui.docker.localhost (admin/changeme)
After terraform apply:
- http://prometheus.docker.localhost
- http://thanos-store.docker.localhost
- http://thanos-compactor.docker.localhost
- http://thanos-query.docker.localhost
- http://thanos-query-frontend.docker.localhost
- http://grafana.docker.localhost
Everytime you add/update/remove rules or scrape configs, do a prometheus reload:
$ curl -X POST http://prometheus.docker.localhost/-/reload$ dig +short srv grafana-http.monitoring-system.service.nomad @10.1.0.5 -p 1053Contributions are welcome! Feel free to fork the repository and submit a pull request.