added HPA and replication

This commit is contained in:
2025-12-18 15:53:06 +03:00
parent 514b401aae
commit 00337aa42a
4 changed files with 44 additions and 2 deletions

View File

@@ -4,7 +4,7 @@ metadata:
name: mongo-generator name: mongo-generator
namespace: genearator-stack namespace: genearator-stack
spec: spec:
replicas: 1 replicas: 2
selector: selector:
matchLabels: matchLabels:
app: mongo-generator app: mongo-generator

View File

@@ -4,7 +4,7 @@ metadata:
name: pg-generator name: pg-generator
namespace: genearator-stack namespace: genearator-stack
spec: spec:
replicas: 1 replicas: 2
selector: selector:
matchLabels: matchLabels:
app: pg-generator app: pg-generator

View File

@@ -0,0 +1,21 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: mongo-generator-hpa
namespace: genearator-stack
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: mongo-generator
minReplicas: 2
maxReplicas: 5
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70

View File

@@ -0,0 +1,21 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: pg-generator-hpa
namespace: genearator-stack
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: pg-generator
minReplicas: 2
maxReplicas: 5
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70