From 761a76c9bde596df85548e06e876bec4ad5eac5f Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 12 Nov 2024 23:30:49 +0100 Subject: [PATCH] added autoscaler to cluster --- config/deployment.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/config/deployment.yml b/config/deployment.yml index 609fd65a..d25a425c 100644 --- a/config/deployment.yml +++ b/config/deployment.yml @@ -5,7 +5,6 @@ metadata: labels: app: deepface spec: - replicas: 1 selector: matchLabels: app: deepface @@ -41,3 +40,22 @@ spec: targetPort: 5000 selector: app: deepface + +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: deepface-autoscaler +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: deepface + minReplicas: 2 + maxReplicas: 20 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 50