NOTE: For the complete solution, please check ansitheus.
-
Inspired by OpenStack Kolla-ansible: You can recognize that Prompose is very similar with Kolla-ansible.
-
Install Docker and Docker-compose in multiple hosts.
-
Easily configure and deploy containerized Prometheus stack: Prometheus, Alertmanager, its exporter, Telegram Bot for Prometheus's Alertmanager and Grafana in multiple hosts.
-
In the origin version, I used docker-compose to deploy Prometheus monitoring stack. Therefore
Prompose
is born, simply it isPrometheus + Docker-compose = Prompose
. This version stills available pure-docker-compose branch. -
The current version is using ansible and its docker_service module to configure number of exporters, port... and deploy Prometheus stack in several hosts easily.
-
Why don't use docker_container module? Just because I found this after docker_service. Maybe will use it in the future?
- Firstly, you have to install ansible (>=2.4) in your management host. There are multiple ways to install ansible, but you simply use requirements.txt. You should have
python-pip
andpython-dev
as well.
$ sudo pip install -r requirements.txt
- Create
/etc/prompose
directory and copy etc/prompose.yml config file. You can put config in whatever directory you want, but then when execute command, you have to use--configdir
option to point to the directory.
$ sudo mkdir /etc/prompose
$ sudo cp etc/prompose.yml /etc/prompose/prompose.yml
-
Read the config file and ansible/group_vars/all.yml file (The options in this file can be overriden in
prompose.yml
') carefully, then do the change in config file you copied in previous step (by default it is )/etc/prompose/prompose.yml
). -
Prepare your inventory file - defines your hosts. Example file can be found here.
-
Run Prompose, point to inventory file with option
--inventory|-i
:
$ sudo ./tools/prompose -i ansible/inventory/all-in-one -h
Usage: ./tools/prompose COMMAND [option]
Options:
--inventory, -i <inventory_path> Specify path to ansible inventory file
--configdir, -c <config_path> Specify path to directory with prompose.yml
--verbose, -v Increase verbosity of ansible-playbook
--help, -h Show this usage information
--images Remove images when this option is defined and command is remove
--volumes Remove volumes when this option is defined and command is remove
Commands:
installdocker Install docker & docker-compose in target hosts
precheck Do pre-deployment checks for hosts
deploy Deploy and start all prompose containers
stop Stop all prompose containers
pull Pull all images for containers (only pull, no running containers)
remove Stop and remove all prompose containes (With --images - remove images and --volumes - remove volumes)
restart Restart all prompose containers
- Enjoy it!
-
If you are interesed with this project, feel free to create a pull request.
-
If you have any questions, please contact me via email
[email protected]
.