This project is using Canonical Operator Framework
The main idea is to simplify python application deployment by using Gunicorn to serve it to the internet
- Install and bootstreap k8s with juju (https://juju.is/docs/kubernetes)
- Install charmcraft with
sudo snap install charmcraft.
- Build charm
charmcraft build - Deploy charm
juju deploy ./python-application-operator.charm --config examples/config_site1.yaml
- Python: Charm can use any official python image based on ubuntu which can be defied as
imageparameter - Repostiory: Currently only publicly available (or without authorization) repositores are supported
- Entrypoint: Application shoul be prepared to work with WSGI servers and application entrypoint shold be provided.
Read config.yaml
Sample application that are were tested:
-
https://github.com/kirek007/python-hello-web
To deploy use
juju deploy ./python-application-operator.charm --config examples/config_flask.yaml -
https://github.com/django-ve/django-helloworld
To deploy use
juju deploy ./python-application-operator.charm --config examples/config_django.yaml
Create and activate a virtualenv with the development requirements:
virtualenv -p python3 venv
source venv/bin/activate
pip install -r requirements-dev.txt
Tests are not implemented but scaffolding is ready
The Python operator framework includes a very nice harness for testing
operator behaviour without full deployment. Just run_tests:
./run_tests