Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ jobs:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
role-session-name: github-actions-deploy
aws-region: ${{ env.AWS_REGION }}

- name: Update kubeconfig
Expand All @@ -91,7 +91,7 @@ jobs:
run: |
sed -i "s|IMAGE_PLACEHOLDER|$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG|g" simple-app/templates/deployment.yaml
kubectl get ns $NAMESPACE || kubectl create ns $NAMESPACE
kubectl apply -f k8s/
helm upgrade --install simple-app ./simple-app --namespace $NAMESPACE --set image.tag=$IMAGE_TAG
kubectl rollout status deployment/$ECR_REPOSITORY -n $NAMESPACE

summary-notif:
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ A simple python fastApi app (serves as a placeholder for real app) used to demon
GitHub Push → GitHub Actions → Build & Test → Push to ECR → Deploy to EKS → Live App
```

## Diagram
![diagram image](diagram/diagram.png)

You can check the code here
[diagram code](images/diagram-code.txt)

## Stack Breakdown
- python **v3.14.3**
- Docker **v29.3.0** (both client and server)
Expand Down
67 changes: 67 additions & 0 deletions diagram/diagram-code.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
direction: down

Internet [icon: globe]
VPC [icon: aws-vpc, color: teal]{
publicSubnetA[icon: aws-subnet, label: "public subnet a\n10.0.1.0/24\nus-east-1a"]

publicSubnetB[icon: aws-subnet, label: "public subnet b\n10.0.2.0/24\nus-east-1b"]

RouteTable[icon: aws-route-table, label: "route table\n0.0.0.0/0"]

IGW [icon: aws-internet-gateway, label:"internet gateway"]


EKSCluster [icon: aws-eks, label: "eks cluster\nsimple-app-cluster"]{
NodeGroup [icon: aws-ec2, label:"node group\nt3.micro . min1/des2/max3"]

IngresssNignx [icon: kubernetes,label: "ingress-nginx\nhelm release . LoadBalancer"]

AppPod [icon: docker, label: "fastapi pod\nhelm chart -> simple-app"]
}
}

IAMGroup [label: "IAM", color: amber] {
EKSRole [icon: aws-iam-role, label: "eks role\nAmazonEKSClusterPolicy"]
NodeRole [icon: aws-iam-role, label: "node role\nWorkerNode . CNI . ECR"]
GHARole [icon: aws-iam-role, label: "github actions role\nOIDC . no stored keys"]
}

ECR [icon: aws-ecr, label: "ecr repository\nsimple-app image"]

GitHub [icon: gihub, color: gray]{
CI [icon: github-actions, label: "ci.yaml\ntest -> build"]
CD [icon: github-actions, label: "cd.yaml\nhelm upgrade -> eks"]
}

Internet -> IGW [label: "inbound traffic"]: [textSize: large, color: red]
IGW -> RouteTable
RouteTable -> publicSubnetA
RouteTable -> publicSubnetB
publicSubnetA -> EKSCluster: [textSize: large, color: "#32dcd9"]
publicSubnetB -> EKSCluster: [color: "#23ecbf"]
IngresssNignx -> AppPod [label: "Route"]

NodeGroup -> IngresssNignx
EKSRole -> EKSCluster [label: "assume role"]: [textSize: medium, color: green]
NodeRole -> NodeGroup [label: "assume role"]: [textSize: medium, color: green]
GHARole -> ECR [label: "push image"]: [textSize: medium, color: blue]
GHARole -> EKSCluster [label: "helm deploy"]: [textSize: medium, color: blue]
CD -> ECR [label :"docker build & push"]: [color: "#fdc660", textSize: medium]
CD -> EKSCluster [label: "helm upgrade"]: [textSize: medium, color: "#e88138"]
ECR -> NodeGroup [label: "pull image"]: [textSize: medium, color: "#763ae8"]
CD -> GHARole [label: "oidc auth"]: [textSize: medium, color: blue]
CD -> Discord [label: "notify"] : [textSize: large, color: red]
CI -> Discord : [textSize: medium, color: red]
Discord -> Developer Device [icon: device]: [textSize: medium, color: red]
Policies {
NodePolicy
EKSPolicy
CNIPolicy
ECRPolicy
}

NodeRole -> NodePolicy: [textSize: medium, color: green]
NodeRole -> CNIPolicy: [textSize: medium, color: green]
NodeRole -> ECRPolicy: [color: green, textSize: medium]
EKSRole -> EKSPolicy: [textSize: large, color: purple]

Binary file added diagram/diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading