A simple two-tier web app, using Flask and MongoDB to experiment and learn Kubernetes capabilities.
This is only the "development" part of the services, which contains solely the code for the application, and whose generated artifact(s) are the Docker containers.
The associated "deployment" project contains all the necessary automation to deploy the service on a Kubernetes cluster.
Build the container (the value of $VERSION
will be derived from build.settings
):
$ ./build.py
[SUCCESS] Image massenz/simple-flask:$VERSION built
then run it (get the current version from build.settings
):
$ docker run --rm -d mongo:3.7
$ docker run --rm -d -p 8088:8080 massenz/simple-flask:$VERSION
the server is then reachable at [http://localhost:8080].
You can change some of the server arguments using the following --env
args:
$ docker run --rm -d -p 8088:8080 massenz/simple-flask:$VERSION \
--env DEBUG='--debug' --env SERVER_PORT=9900 --env SECRET='chang3Me'
Before deploying the application to Kubernetes, push the built containers to Docker Hub:
$ ./build.py --push
TODO: Describe the API here
The main service page (index.html
) will show a brief summary of the available endpoints: reach the service from a browser at http://localhost:8080
.