Skip to content

Commit

Permalink
feat(k8) Added k8s/manifests for frontend and backend
Browse files Browse the repository at this point in the history
  • Loading branch information
Uj5Ghare authored Dec 8, 2024
1 parent d7239e6 commit 5291dd5
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 0 deletions.
29 changes: 29 additions & 0 deletions k8s/manifests/backend/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This is a sample deployment manifest file for a simple web application.
apiVersion: apps/v1
kind: Deployment
metadata:
name: node-deployment
namespace: app
labels:
app: node
spec:
replicas: 2
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 25%
selector:
matchLabels:
app: node
template:
metadata:
labels:
app: node
spec:
containers:
- name: node-con
image: uj5ghare/eng-backend:latest
ports:
- containerPort: 8000
imagePullPolicy: Always
25 changes: 25 additions & 0 deletions k8s/manifests/backend/hpa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: node-hpa
namespace: app
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: node-deployment
minReplicas: 1
maxReplicas: 3
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 80
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 80
16 changes: 16 additions & 0 deletions k8s/manifests/backend/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Service for the application
apiVersion: v1
kind: Service
metadata:
name: node-svc
namespace: app
labels:
app: node
spec:
ports:
- port: 80
targetPort: 8000
protocol: TCP
selector:
app: node
type: ClusterIP
29 changes: 29 additions & 0 deletions k8s/manifests/frontend/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This is a sample deployment manifest file for a simple web application.
apiVersion: apps/v1
kind: Deployment
metadata:
name: react-deployment
namespace: app
labels:
app: react
spec:
replicas: 2
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 25%
selector:
matchLabels:
app: react
template:
metadata:
labels:
app: react
spec:
containers:
- name: react-con
image: uj5ghare/eng-frontend:latest
ports:
- containerPort: 3000
imagePullPolicy: Always
25 changes: 25 additions & 0 deletions k8s/manifests/frontend/hpa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: react-hpa
namespace: app
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: react-deployment
minReplicas: 1
maxReplicas: 3
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 80
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 80
16 changes: 16 additions & 0 deletions k8s/manifests/frontend/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Service for the application
apiVersion: v1
kind: Service
metadata:
name: react-svc
namespace: app
labels:
app: react
spec:
ports:
- port: 80
targetPort: 3000
protocol: TCP
selector:
app: react
type: ClusterIP

0 comments on commit 5291dd5

Please sign in to comment.