This is the project involves: Server Deployment, Containerization, and Testing.
It is containerized and deployed as a Flask API to a Kubernetes cluster using Docker, AWS EKS, CodePipeline, and CodeBuild.
The Flask app that is used for this project consists of a simple API with three endpoints:
GET '/': This is a simple health check, which returns the response 'Healthy'.POST '/auth': This takes a email and password as json arguments and returns a JWT based on a custom secret.GET '/contents': This requires a valid JWT, and returns the un-encrpyted contents of that token.
The app relies on a secret set as the environment variable JWT_SECRET to produce a JWT. The built-in Flask server is adequate for local development, but not production, so the production-ready Gunicorn server is used to deploy the app.
-
Python 3.7
- Follow instructions to install the latest version of python for your platform in the [python docs] (https://docs.python.org/3/using/unix.html#getting-and-installing-the-latest-version-of-python)
-
Docker Engine
-
AWS Account
- You can create an AWS account by signing up here.
Completing the project involved several steps:
- Write a Dockerfile for a simple Flask API
- Build and test the container locally
- Create an EKS cluster
- Store a secret using AWS Parameter Store
- Create a CodePipeline pipeline triggered by GitHub checkins
- Create a CodeBuild stage which will build, test, and deploy your code