From 6d68acb676f187fd8161092af1afb67e16374b32 Mon Sep 17 00:00:00 2001 From: Naasir Date: Tue, 9 Jan 2024 17:16:13 +0530 Subject: [PATCH] added HPA to svc section --- deployments/node-version-blue.yaml | 23 +---------------------- deployments/node-version-green.yaml | 22 ---------------------- deployments/svc-blue.yaml | 25 ++++++++++++++++++++++++- deployments/svc-green.yaml | 24 +++++++++++++++++++++++- 4 files changed, 48 insertions(+), 46 deletions(-) diff --git a/deployments/node-version-blue.yaml b/deployments/node-version-blue.yaml index 74b7c3b..5f76332 100644 --- a/deployments/node-version-blue.yaml +++ b/deployments/node-version-blue.yaml @@ -51,26 +51,5 @@ spec: key: ENV resources: {} status: {} ---- -apiVersion: "autoscaling/v2" -kind: "HorizontalPodAutoscaler" -metadata: - name: "node-app-hpa-wvpn" - namespace: "default" - labels: - app: "node-app" -spec: - scaleTargetRef: - kind: "Deployment" - name: "node-app-blue" - apiVersion: "apps/v1" - minReplicas: 1 - maxReplicas: 5 - metrics: - - type: "Resource" - resource: - name: "cpu" - target: - type: "Utilization" - averageUtilization: 80 + diff --git a/deployments/node-version-green.yaml b/deployments/node-version-green.yaml index 99ed339..c3faea9 100644 --- a/deployments/node-version-green.yaml +++ b/deployments/node-version-green.yaml @@ -51,25 +51,3 @@ spec: key: ENV resources: {} status: {} ---- -apiVersion: "autoscaling/v2" -kind: "HorizontalPodAutoscaler" -metadata: - name: "node-app-hpa-wvpn" - namespace: "default" - labels: - app: "node-app" -spec: - scaleTargetRef: - kind: "Deployment" - name: "node-app-green" - apiVersion: "apps/v1" - minReplicas: 1 - maxReplicas: 5 - metrics: - - type: "Resource" - resource: - name: "cpu" - target: - type: "Utilization" - averageUtilization: 80 diff --git a/deployments/svc-blue.yaml b/deployments/svc-blue.yaml index 7d4d9f2..3f107d5 100644 --- a/deployments/svc-blue.yaml +++ b/deployments/svc-blue.yaml @@ -15,4 +15,27 @@ spec: version: "blue" type: NodePort status: - loadBalancer: {} \ No newline at end of file + loadBalancer: {} + +--- +apiVersion: "autoscaling/v2" +kind: "HorizontalPodAutoscaler" +metadata: + name: "node-app-hpa-wvpn" + namespace: "default" + labels: + app: "node-app" +spec: + scaleTargetRef: + kind: "Deployment" + name: "node-app-blue" + apiVersion: "apps/v1" + minReplicas: 1 + maxReplicas: 5 + metrics: + - type: "Resource" + resource: + name: "cpu" + target: + type: "Utilization" + averageUtilization: 80 \ No newline at end of file diff --git a/deployments/svc-green.yaml b/deployments/svc-green.yaml index 3abb531..8afd415 100644 --- a/deployments/svc-green.yaml +++ b/deployments/svc-green.yaml @@ -15,4 +15,26 @@ spec: version: "green" type: NodePort status: - loadBalancer: {} \ No newline at end of file + loadBalancer: {} +--- +apiVersion: "autoscaling/v2" +kind: "HorizontalPodAutoscaler" +metadata: + name: "node-app-hpa-wvpn" + namespace: "default" + labels: + app: "node-app" +spec: + scaleTargetRef: + kind: "Deployment" + name: "node-app-green" + apiVersion: "apps/v1" + minReplicas: 1 + maxReplicas: 5 + metrics: + - type: "Resource" + resource: + name: "cpu" + target: + type: "Utilization" + averageUtilization: 80 \ No newline at end of file