Example of setting up a cloud native application using FastAPI, Docker, Pytest, GitHub Actions, and Kubernetes.
conda env create -f environment.ymlfastapi dev main.pycurl -X 'POST' \
'http://127.0.0.1:8000/' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"name": "test item",
"description": "test",
"value": 100
}'pytest testsdocker build -t simple-app .docker run -d --name simple-app-container -p 80:80 simple-appcurl -X 'POST' \
'http://localhost:80/' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"name": "test item",
"description": "test",
"value": 100
}'Several tests will run when there is a push or pull request to the git main branch. These are defined in ./github/workflows/ and include:
- run pytests (see ./tests/)
- build and test docker container
- Set up local Kubernetes cluster using Minikube. Deploy containerized app.
- Update set up to include more than one microservice.