Easily deploy and operate your Flask or Django applications and associated infrastructure, such as databases and ingress, using open source tooling. This lets you focus on creating applications for your users backed with the confidence that your operations are taken care of by world class tooling developed by Canonical, the creators of Ubuntu.
Have you ever created an application and then wanted to deploy it for your users only to either be forced to use a proprietary public cloud platform or manage the deployment and operations yourself? PaaS App Charmer will take your application and create an OCI image using Rockcraft and operations code using Charmcraft for you. The full suite of tools is open source so you can see exactly how it works and even contribute! After creating the app charm and image, you can then deploy your application into any Kubernetes cluster using Juju. Need a database? Using Juju you can deploy a range of popular open source databases, such as PostgreSQL or MySQL, and integrate them with your application with a few commands. Need an ingress to serve traffic? Use Juju to deploy and integrate a range of ingresses, such as Traefik, and expose your application to external traffic in seconds.
There are 2 requirements for the flask application:
requirements.txt
file in the project rootapp:app
Make sure that you have the latest/edge
version of Charmcraft and Rockcraft
installed:
sudo snap install charmcraft --channel latest/edge --classic
sudo snap install rockcraft --channel latest/edge --classic
Both have the flask-framework
profile to create the required files
and include the flask-framework
extension which will do all the hard
operational work for you and you just need to fill in some metadata in the
rockcraft.yaml
and charmcraft.yaml
files. To create the necessary files:
rockcraft init --profile flask-framework
mkdir charm
cd charm
charmcraft init --profile flask-framework
After packing the rock and charm using rockcraft pack
and charmcraft pack
and uploading the rock to a k8s registry, you can juju deploy your flask
application, integrate it with ingress and start serving traffic to your users!
Read the comprehensive getting started tutorial for more!
Additional resources:
flask-framework
referenceflask-framework
how to guidesflask-framework
referenceIs there something missing from the PaaS App Charmer framework? PaaS App Charmer welcomes contributions! This section covers how to add a new integration and a new framework.
There are a few recommended steps to add a new integration which we'll go through below.
paas-app-charmer
. Take a look at
charm.py
for gunicorn
based
frameworks for integration examples.requires
to all the relevant Charmcraft
templates
for the new integrationThere are a few recommended steps to add a new framework which we'll go through below.
rockcraft.yaml
file and build a working OCI image. To
see an example for flask
, install Rockcraft and run
rockcraft init --profile flask-framework
and run
rockcraft expand-extensions
and inspect the output.charmcraft.yaml
file and build a working charm. To see
an example for flask
, install Charmcraft and run
charmcraft init --profile flask-framework
and run
charmcraft expand-extensions
and inspect the output.