flask-app-kubernetes
Sample Dokerized flask app deployed on Kubernetes on Azure using AKS
Overview
Running this app
1. As a standalone app
- install python
git clonethe project thencdinto the directory- run
virtualenv -p /usr/bin/python3 venvorpython -m venv venvto create a virtual environment - activate it using
source venv/bin/activate pip install -r requirements.txtto install the app libaries and it dependencies
running the app
After installing, run the server using python main.py Access the running app in a browser at the URL written to the console (most likely http://localhost:5000)
2. As a Docker container running on your machine
- install Docker
run docker --versionto check if docker is installed- run
docker build -t flask-app-kubernetes:latest .to build the docker image docker imageslist the local avaible images- run
docker run --name flask-app-kubernetes -d -p 5000:5000 --rm flask-app-kubernetes:latestto start the container - Navigate to http://localhost:5000 in a browser to see the results. If you want to share it with your local network devices navigate to http://[your-ip-address]:5000