In this project, I'm the Platform Engineer, tasked with taking an existing Flask application and applying the following practices to make it cloud native. This involves:
- Increase the
Observability
of the application. This includes creating API endpoints to gather metrics/metrics
as well as the status/healthz
. Logging was also done to allow for tracing of errors. - Containerizing the application, which involves creating a
Dockerfile
and a.dockerignore
(optional) - Creating a
Continuous Integration
pipeline usingGithub Actions
. Once themain
branch is updated, a docker image of the application is built and pushed to Container repository (Docker Hub). Ideally, automated tests should be performed prior to packaging the application, but not required for this exercise. - Creating Kubernetes manifests for the application. This allows the application to be deployed in a cluster, in its own namespace.
- Using a configuration management tool (Helm) to set up different configurations of the application (e.g. sandbox, staging, production).
- Using a
Continuous Delivery
tool (ArgoCD) to release different versions of the application.
- Used
Python 3
for the Docker base image instead ofPython 2
. This was required asf-strings
were used for application logging. F-strings requires Python3.6
or newer. See https://realpython.com/python-f-strings/ - Used Helm Chart
apiVersion: v2
, as this is the default value when initialized usinghelm create
. Also,helm lint
fails whenever it was set tov1
. - The Vagrantfile was updated as follows:
- OpenSUSE Leap 15.3
- Use a different IP for the guest OS from the one suggested as it was unavailable.
- Installing k3s, helm and argocd on
vagrant up
using the shell provisioning. - Patch the argocd server by changing it from ClusterIP to NodePort, and exposing the relevant port