This is repository for the DevOps Engineering course in Innopolis University
Table of contents:
app_python
folder contains python web app and necessary files for Dockerapp_python/app_files
folder contains the app itself, which shows current datetime inEurope/Moscow
timezone. This app uses Django framework. It keeps datetimes of all requests to/
inlogs/access.txt
file, accessable via/visits
endpoint..github/workflows
folder contains workflows for testing the app and publishing it to the docker hubvagrant
folder contains Vagrantfile for managing VM, which works on both VirtualBox and Google Cloud Platformansible
folder contains playbooks and roles for provisioning the VM (installing docker and running image from dockerhub)monitoring
folder contains stuff necessary for grafana/promtail/loki/prometheus stackk8s
folder 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