From 284331b7b14a54c37978d1979075ff7dd3464522 Mon Sep 17 00:00:00 2001 From: Kevin Wan Date: Sun, 26 Feb 2023 22:32:27 +0800 Subject: [PATCH] fix: #2899, using autoscaling/v2beta2 instead of v2beta1 (#2900) * fix: #2899, using autoscaling/v2 instead of v2beta1 * chore: change hpa definition --------- Co-authored-by: kevin.wan --- tools/goctl/kube/deployment.tpl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/goctl/kube/deployment.tpl b/tools/goctl/kube/deployment.tpl index 95c698cb..14145df2 100644 --- a/tools/goctl/kube/deployment.tpl +++ b/tools/goctl/kube/deployment.tpl @@ -70,7 +70,7 @@ spec: --- -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name: {{.Name}}-hpa-c @@ -88,11 +88,13 @@ spec: - type: Resource resource: name: cpu - targetAverageUtilization: 80 + target: + type: Utilization + averageUtilization: 80 --- -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name: {{.Name}}-hpa-m @@ -110,4 +112,6 @@ spec: - type: Resource resource: name: memory - targetAverageUtilization: 80 + target: + type: Utilization + averageUtilization: 80