This is a cookiecutter template for quickly deploying a Flask app on Kubernetes. It is setup with NGINX as a reverse proxy to serve the static files underneath the web/static directory.
- You'll need a Kubernetes cluster, such as minikube or Google Kubernetes Engine.
- kubectl
- Cookiecutter should be installed in a Python environment:
$ pip install cookiecutter
Clone the repository:
$ git clone https://github.com/ritchie46/kubernetes-flask-nginx-cookiecutter.git
Run cookiecutter to create a new project:
$ cookiecutter kubernetes-flask-nginx-cookiecutter
$ cd <your-directory-name>
You can build the Flask app and push it to Docker hub or any other container registry you've set.
$ ./build_and_push
Create all the kubernetes resources:
$ ./create_all
This creates a service on the kubernetes cluster. The hello world is visible at the clusters external ip. On minikube this is:
$ minikube service <app_name-service>
Remove all the resources:
$ ./delete_all