This is repository for the DevOps Engineering course in Innopolis University
Table of contents:
app_pythonfolder contains python web app and necessary files for Dockerapp_python/app_filesfolder contains the app itself, which shows current datetime inEurope/Moscowtimezone. This app uses Django framework. It keeps datetimes of all requests to/inlogs/access.txtfile, accessable via/visitsendpoint..github/workflowsfolder contains workflows for testing the app and publishing it to the docker hubvagrantfolder contains Vagrantfile for managing VM, which works on both VirtualBox and Google Cloud Platformansiblefolder contains playbooks and roles for provisioning the VM (installing docker and running image from dockerhub)monitoringfolder contains stuff necessary for grafana/promtail/loki/prometheus stackk8sfolder contains configs for kubernetes & helm, which also demonstrates work with charts, secrets, resource management, config maps, stateful sets, kube prometheus stack, and init containers
The simplest way is to use docker:
docker run -p 5000:5000 kezzyhko/devops
If you do not want to use docker for some reason, then clone the repo, install requirements.txt and run main.py:
git clone https://github.com/kezzyhko/devops.git
pip3 install -r ./devops/app_python/requirements.txt
python3 ./devops/app_python/app_files/main.py
By default, app is accessible on port 5000
The unit tests for this app are located at app_files/tests.py.
There are three tests, which test the datetime_view view, located in the app_files/views.py.
If you want to use it locally using VirtualBox, the following command will be enough:
vagrant up --provider=virtualbox
If you want to use it with Google Cloud, then you need to change constants in Vagrantfile, add necessary key files and then use the following command:
vagrant up --provider=google
Ansible provisioning is automatically executed when using vagrant up <...>.
If you want to run it manually, use vagrant provision or configure ansible hosts and execute the playbook