Git Hub Link for details:
https://github.com/sunnysavita10/ecomm-prod-assistant
Check out this 5 files:
1. ecomm-prod-assistant/.github/workflows /infra.yml
2. ecomm-prod-assistant/.github/workflows /deploy.yml
3. k8/deployment.yaml
4. k8/service.yaml
5. ecomm-prod-assistant
/infra/eks-with-ecr.yaml
How these 5 files are interconnected with each other
Perfect question — this is exactly where most beginners get confused.
I’ll explain this in a simple story + flow + memory trick so you never forget it.
You have 5 files → they act like different roles in opening & running a restaurant
infra/eks-with-ecr.yaml👉 "Blueprint of your infrastructure"
Defines:
EKS Cluster (Kubernetes)
ECR (Docker image storage)
Written in CloudFormation / IaC
📌 Think:
👉 "What resources should exist in AWS?"
.github/workflows/infra.yml👉 "Builder of infrastructure"
Runs the above file
Creates:
EKS cluster
ECR repo
📌 Think:
👉 "Execute the blueprint"
.github/workflows/deploy.yml👉 "Chef + Delivery system"
Builds Docker image
Pushes to ECR
Connects to EKS
Applies Kubernetes files
📌 Think:
👉 "Take my app and deploy it"
k8/deployment.yaml👉 "How your app runs"
Number of replicas
Container image
CPU/memory
Ports
📌 Think:
👉 "How should my app behave inside Kubernetes?"
k8/service.yaml👉 "How users access your app"
Exposes app to internet
Creates LoadBalancer
📌 Think:
👉 "How will users reach my app?"
👉 You manually trigger:
infra.yml
GitHub Action runs
It reads:
infra/eks-with-ecr.yaml
AWS creates:
EKS Cluster
ECR Repository
✅ Now your platform is ready
👉 You push code to GitHub
git push origin main
This triggers:
deploy.yml
Inside deploy.yml:
docker build → docker push (ECR)
📌 Result:
👉 Your app image is now inside ECR
aws eks update-kubeconfig
📌 Now GitHub Actions can talk to your cluster
kubectl apply -f k8/deployment.yaml
kubectl apply -f k8/service.yaml
Pulls image from ECR
Creates Pods (your app running)
Creates LoadBalancer
Gives public URL
User → LoadBalancer → Service → Pods → Container (Your App)
🎉 Your app is LIVE
| File | Connected To | Purpose |
|---|---|---|
infra.yml | eks-with-ecr.yaml | Creates infra |
deploy.yml | ECR + EKS + k8 files | Deploys app |
deployment.yaml | ECR image | Runs app |
service.yaml | deployment | Exposes app |
eks-with-ecr.yaml | AWS | Defines infra |
Use this:
👉 infra.yml + eks-with-ecr.yaml
➡️ Creates AWS infra
👉 deploy.yml
➡️ Builds Docker image
👉 deployment.yaml
➡️ Runs app in Kubernetes
👉 service.yaml
➡️ Makes app public
👉
Infra builds the playground → Deploy puts your app → K8 runs it → Service shows it to world
infra.yml runs rarely (once)
deploy.yml runs every code change
k8 files are instructions for Kubernetes
ECR is bridge between build & deploy