Python Flask based microservices application dockerised and published to centralised image repository (Docker Hub), deployed to an AWS EKS cluster via CircleCI pipeline using EKS rolling deployment.
- CircleCI
- AWS EKS (Kubernetes)
- Docker Hub
- msaginwm/devsecops-base:2023.04 (DevSecOps Docker image)
- Download or clone this project
- Push this project to your GitHub repository
- Create a CricleCI account and set up the project (using the pipeline already defined in the config.yml file).
- Add the AWS credentials as environment variables. Configure
AWS_ACCESS_KEY_ID
,AWS_SECRET_ACCESS_KEY
andAWS_DEFAULT_REGION
as CircleCI project or context environment variables as shown in the links provided for project or context.
- Run the Pipeline by pushing a new commit to the Git Hub repository or trigger the pipeline manually in the project’s GUI in CircleCI
- To access the application APIs, copy the Load Balancer URL to your browser
- build-and-test: create a Python virtual environment then run hadolint (lint for Dockerfile) and pylint (lint for Python code).
- static-application-security-testing: run pip-audit (vulnerability scanning the application dependencies) and bandit (vulnerability scanning the application code).
- docker publish: dockerise the application and publish it to DockerHub.
- deploy-infrastructure: deploy AWS infrastructure via AWS CloudFormation (EKS cluster included).
- deploy-workload: deploy the application Docker image to the EKS cluster.
- smoke-test: get the service endpoint URL and run a smoke test on its health check API.
- Architecture diagram
- Screenshots about the CircleCI pipeline stages screenshot1 screenshot2
- Screenshots for release v1.0.1
- EKS Workload screenshot1 screenshot2 screenshot3
- EC2 instances screenshot1 screenshot2 screenshot3
- Screenshots for release v1.0.2
- EKS Workload screenshot1 screenshot2 screenshot3
- EKS Elastic Load Balancer URL - Service Status API response screenshot1
- EC2 instances screenshot1 screenshot2 screenshot3