Skip to content

massenz/k8s-web

Repository files navigation

Simple Web Application -- k8s-webserver

Version Released

Author License OS Debian

A simple two-tier web app, using Flask and MongoDB to experiment and learn Kubernetes capabilities.

GitOps Model

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.

Container Build

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

Service API

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.

About

A simple two-tier web app, using Flask and MongoDB to experiment and learn Kubernetes capabilities.

Resources

Stars

Watchers

Forks

Packages

No packages published