A production-style FlappyBird microservices project with end-to-end DevSecOps and GitOps:
- CI: GitHub Actions (SonarCloud, Trivy image scan, OWASP deps)
- CD: Argo CD + Helm charts
- Infra: Terraform (VPC, EKS, RDS)
- App: Frontend (React) + Backend (Flask + SQLAlchemy) + RDS PostgreSQL
- Observability: Prometheus + Grafana (packaged in Helm; Grafana and FrontEnd Service exposed by LoadBalancer)
- Security: least privilege security groups, Kubernetes Secret for DB password
-
Provision infra using Terraform → EKS + RDS + VPC
-
Provide DB password to Terraform (prompt or env):
TF_VAR_db_password -
Terraform outputs
rds_endpoint -
Create Kubernetes namespace
flappyand a Kubernetes Secret with DB password (from step 2) -
Edit Helm
values.yaml(image repository names, RDS endpoint) -
Push changes → GitHub Actions builds images, runs SonarCloud/Trivy tests, and updates Helm values (or you can commit them manually)
-
Apply Argo CD App in cluster (it will deploy Helm charts which include Prometheus+Grafana). Grafana has
service.type: LoadBalancerand will get a public LoadBalancer DNS. -
Access app + Grafana. Seed data or create DB if needed.
git clone https://github.com/Techikrish/Flappybird-DevSecOps
cd Flappybird-DevSecOps
Option A — provide DB password interactively (Terraform prompt):
cd infra/terrafrom
export DB_PASSWORD="YourSecurePassword123!"
terraform apply \
-var="db_password=$DB_PASSWORD" \
-var="aws_region=us-east-1" \
-var="project_name=flappybird"
- Terraform will create VPC, subnets, EKS, node group, security groups, RDS instance.
- After apply completes, copy the RDS endpoint from Terraform output (or check
terraform output rds_endpoint).
Once complete, configure kubectl:
aws eks --region us-east-1 update-kubeconfig --name <your-cluster-name> kubectl get nodes
Create namespace flappy
kubectl create namespace flappy
Create secret with DB password (use the same password you supplied to Terraform):
kubectl create secret generic flappybird-backend-db \
--from-literal=DB_PASS="$DB_PASSWORD" \
--namespace flappybird
Open helm/flappybird/values.yaml and update:
image:
repository: docker.io/techikrish/flappybird-frontend # <-- your Docker Hub re
image:
repository: docker.io/techikrish/flappybird-backend # <-- your Docker Hub repo
helm/flappybird/values.yaml
db:
host: rds endpoint # fill with Terraform rds_endpoint
name: flappydb
user: flappy
# password will be read from Kubernetes secret flappy-db-secret
Important: DB_HOST must be hostname only — do not append :5432. The code adds the port separately.
- Go to https://sonarcloud.io/
- Click Log in
- Choose:
- GitHub (recommended)
Once you sign in → you will land on the SonarCloud dashboard.
- Go to My Account → Organizations
- Click “Create Organization manually”
- Fill:
- Organization Name
- Unique Organization Key
- Choose Free plan (public projects)
If using GitHub app:
- Go to Projects → Analyze New Project
- Select your connected GitHub repository (example:
DevSecOps-FlappyBird) - Click Set Up
- Choose:
- Build method → GitHub Actions
- SonarCloud will:
- Generate your project key
- Show the sample GitHub Actions YAML
After project creation:
- Go to Project Settings
- Then General Settings → Analysis Scope
- You will see:
sonar.projectKey=<your_project_key>
sonar.organization=<your_organization>
Example:
sonar.projectKey=techikrish_flappybird
sonar.organization=techikrish
You will paste these into your sonar-properties file.
- Click your profile picture → My Account
- Go to Security
- Under “Tokens”, click:
👉 Generate Token
- Give a name →
github-actions-token - Click Generate
- Copy the token ONCE (you can’t see it again)
Open file sonar-properties (repo root) and set:
sonar.projectKey=your_sonar_project_key_here
sonar.organization=your_sonar_org_here
sonar.projectName=flappydevsecops
(You must configure these values in SonarCloud for your project.)
Go to your GitHub repository → Settings → Secrets → Actions. Add:
SONAR_TOKEN→ Generate token in SonarCloud (My Account → Security → Generate token)DOCKER_USERNAME→ Docker Hub usernameDOCKER_TOKEN→ Docker Hub access token (or PAT)
Note: GitHub Actions provides GITHUB_TOKEN automatically; you do not need to add it manually.
Push code or change something to trigger the pipeline:
git add .
git commit -m "Update helm values"
git push origin main
GitHub Actions will run:
- Checkout
- Install dependencies
- Run SonarCloud (requires
SONAR_TOKEN) - Run Trivy scan for images
- Build Docker images and push to
docker.io/techikrish/*(requiresDOCKER_USERNAME&DOCKER_TOKEN) - Update Helm values (if workflow configured to commit new tags) — if not automated, ensure the image tags referenced in Helm match pushed images.
(Argo app is present at argocd/application.yaml)
- Argo install it in cluster:
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
Apply the Argo CD App manifest (it references your repo/helm path):
kubectl apply -f argocd/application.yaml
Argo CD will pick the repo, path and create the Helm release in the flappy namespace. It will also install Prometheus & Grafana (they are packaged inside Helm). Grafana is exposed with service.type: LoadBalancer.
Check pods & services
kubectl get pods -n flappy
kubectl get svc -n flappy
Access the Deployed App
Once deployed, get the LoadBalancer URL:
kubectl get svc -n flappy




