Problem Statement

Microservices are an architectural and organizational approach to software development where software is composed of small independent services that communicate over well-defined APIs. Microservices architectures make applications easier to scale and faster to develop, enabling innovation and accelerating time-to-market for new features. Docker and Kubernetes are almost synonymous to 'microservices' as they help package and manage the different components of a project/ application, thereby easing up the implementation of a microservices architecture.

In this project, you will work with Docker and Kubernetes to make an easily deployable and portable blogging web-app using Flask and MongoDB.

The microservices architecture will deploy a Kubernetes cluster with a mongodb server pod fronted with a web admin interface and a pod to run the flask app.

Pre-Requisites/ Pre-Installation:

  1. Docker (Windows | Ubuntu | MacOS)
  2. Kubernetes (Windows | Ubuntu | MacOS)

File Structure

.
|-- README.md
|-- app
|   |-- app.py
|   |-- requirements.txt
|   `-- templates
|       |-- base.html
|       |-- create-post.html
|       |-- edit-post.html
|       `-- home.html
|-- configmap.yaml
|-- deployments.yaml
|-- dockerfile
|-- secret.yaml
`-- services.yaml

The app directory contains all the code pertaining to the flask app. You are only required to configure the mongo connection string variables as specified in app.py.
The dockerfile should specify the insructions to assemble the docker image for the flask app.
The .yaml files in the root directory are to specify the kubernetes manifests that will bring up your microservices deployment of the problem statement.

Running the app

Once you have the pre-requisites, you can run the app by executing the shell script.

source build.sh