This vagranfile was defined to support the local development of the monitoring components of the piacere project. During intensive debugging of the deployment this avoids lots of git command that: take time, imply many infrastructure requirements (vpn, server, gitlab, ...).
This vagranfile was defined to support the local development of kubernetes multinode with ansible.
It create a machine with docker compose that maps into the folder /monitoring-vagrant
It create a management machine and a four node cluster of kubernetes (k8s), with two masters and two workers.
## Prerequisites
In order to use this vagrantfile you need virtualbox and vagrant.
...
...
@@ -10,52 +10,64 @@ In order to use this vagrantfile you need virtualbox and vagrant.
## Notes
Here we define some particularities of this vagrantifle
* This vagrant file is configured to save the image in a relative ../../vm folder to the location of this vagrantfile.
* This repo is heavily based in submodules, it may happen that you need to contact the repo owner for additional permissions on the included subfolders
* This vagrant file requires some environment variables to be defined in the host machine, they are listed in env.erb. The first two should be provided by someone, others can have any non-empty value.
* CA_API_KEY
* SMTP_API_KEY
* PORTAINER_PASSWORD
* INFLUXD_PASSWORD
* INFLUXD_TOKEN
* GRAFANA_ADMIN_PASSWORD
* The local environment is configured to user the following domains: monitoring.piacere.tri.dev, influxdb.monitoring.piacere.tri.dev, portainer.monitoring.piacere.tri.dev, agent.monitoring.piacere.tri.dev, portainer.monitoring.piacere.tri.dev. These domains should be added into the hosts file (in windows %WINDIR%\System32\drivers\etc\hosts elevated rights are required to edit it) of the host to support the resolution of addresses. The should point to the virtualbox ip i.e. 192.168.56.1 (usually in windows)
* the number of machiens
## How to create
To create the machine clone this repo, go into the folder and execute vagrant up.
This will automatically install ansible and run a playbook that:
* process env.erb and stores under the ansible folder as .env
* install docker
* docker compose
* copy .env under git/monitoring-deploy/.local/.env
* will configure .profile to load git/monitoring-deploy/.local/.env as environment variables when login into the vm
## How to run an docker compose
To run a docker compose, you will need to login into the machine, cd to the docker compose, source environment variables, build and deploy
This will automatically start 5 virtual machines and install ansible in the management machine.
## How to setup kubernetes
This vagrant does not setup kubernetes automatically as it is a testing playground for the kubernetes deployment. It contains a sequence of steps to be performed in order to deploy and test the kubernetes deployment.
Therefore in order to setup kubernetes we have to login into management machine and invoke some scripts that simulate the steps that we will require to do in a on premise environment.
```batch
vagrant ssh
````
once inside, for example to run monitoring vagrant for development