From 361be7eaaa6d2fcfbab7918b104319d3f65598cc Mon Sep 17 00:00:00 2001 From: Khiem Do Date: Tue, 14 Mar 2023 14:54:37 +0700 Subject: [PATCH] HPA: autoscaling/v2beta1 deprecated, bump apiVersion to v2 for defaultBackend --- charts/ingress-nginx/README.md | 1 + charts/ingress-nginx/templates/default-backend-hpa.yaml | 2 +- charts/ingress-nginx/values.yaml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/charts/ingress-nginx/README.md b/charts/ingress-nginx/README.md index 49bb38273b..5e7fa85a19 100644 --- a/charts/ingress-nginx/README.md +++ b/charts/ingress-nginx/README.md @@ -456,6 +456,7 @@ Kubernetes: `>=1.20.0-0` | controller.watchIngressWithoutClass | bool | `false` | Process Ingress objects without ingressClass annotation/ingressClassName field Overrides value for --watch-ingress-without-class flag of the controller binary Defaults to false | | defaultBackend.affinity | object | `{}` | | | defaultBackend.autoscaling.annotations | object | `{}` | | +| defaultBackend.autoscaling.apiVersion | string | `"autoscaling/v2"` | | | defaultBackend.autoscaling.enabled | bool | `false` | | | defaultBackend.autoscaling.maxReplicas | int | `2` | | | defaultBackend.autoscaling.minReplicas | int | `1` | | diff --git a/charts/ingress-nginx/templates/default-backend-hpa.yaml b/charts/ingress-nginx/templates/default-backend-hpa.yaml index 594d26525b..f9ae0b2762 100644 --- a/charts/ingress-nginx/templates/default-backend-hpa.yaml +++ b/charts/ingress-nginx/templates/default-backend-hpa.yaml @@ -1,5 +1,5 @@ {{- if and .Values.defaultBackend.enabled .Values.defaultBackend.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 +apiVersion: {{ .Values.defaultBackend.autoscaling.apiVersion }} kind: HorizontalPodAutoscaler metadata: labels: diff --git a/charts/ingress-nginx/values.yaml b/charts/ingress-nginx/values.yaml index 202cd4a232..031078499f 100644 --- a/charts/ingress-nginx/values.yaml +++ b/charts/ingress-nginx/values.yaml @@ -827,6 +827,7 @@ defaultBackend: # emptyDir: {} autoscaling: + apiVersion: autoscaling/v2 annotations: {} enabled: false minReplicas: 1