Skip to content

Commit 5b2406b

Browse files
committed
feat: automate k8s manifests apply in pipeline
1 parent 18bba38 commit 5b2406b

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

.github/workflows/k8s-deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
# Deploy to Kubernetes cluster (Rolling Update)
5454
- name: Deploy to K8s
5555
run: |
56+
kubectl apply -f k8s/
5657
kubectl set image deployment/receiptsnap-backend \
5758
backend=pratik50/receiptsnap-backend:${{ github.sha }} \
5859
-n backend-team

k8s/hpa.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: autoscaling/v2
2+
kind: HorizontalPodAutoscaler
3+
metadata:
4+
name: receiptsnap-backend-hpa
5+
namespace: backend-team
6+
spec:
7+
scaleTargetRef:
8+
apiVersion: apps/v1
9+
kind: Deployment
10+
name: receiptsnap-backend
11+
minReplicas: 2
12+
maxReplicas: 6
13+
metrics:
14+
- type: Resource
15+
resource:
16+
name: cpu
17+
target:
18+
type: Utilization
19+
averageUtilization: 70
20+
- type: Resource
21+
resource:
22+
name: memory
23+
target:
24+
type: Utilization
25+
averageUtilization: 80

0 commit comments

Comments
 (0)