From c504d9997614a96c3e9df1ad4f9dae62ed9160d9 Mon Sep 17 00:00:00 2001 From: Jonathan Wiemers Date: Thu, 2 Nov 2023 19:47:10 +0100 Subject: [PATCH 1/2] fix: k8s > 1.24 do not support autoscaling/v2beta1 --- charts/mattermost-enterprise-edition/Chart.yaml | 2 +- .../templates/deployment-mattermost-hpa.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/mattermost-enterprise-edition/Chart.yaml b/charts/mattermost-enterprise-edition/Chart.yaml index 49364b2e..148ca2c8 100644 --- a/charts/mattermost-enterprise-edition/Chart.yaml +++ b/charts/mattermost-enterprise-edition/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 description: Mattermost Enterprise server with high availitibity. name: mattermost-enterprise-edition type: application -version: 2.6.37 +version: 2.7.0 appVersion: 9.1.1 keywords: - mattermost diff --git a/charts/mattermost-enterprise-edition/templates/deployment-mattermost-hpa.yaml b/charts/mattermost-enterprise-edition/templates/deployment-mattermost-hpa.yaml index 195feae2..e20bc266 100644 --- a/charts/mattermost-enterprise-edition/templates/deployment-mattermost-hpa.yaml +++ b/charts/mattermost-enterprise-edition/templates/deployment-mattermost-hpa.yaml @@ -1,5 +1,5 @@ {{- if .Values.mattermostApp.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: labels: From 3b0f038fafd78c2b6dd7a1c13034aba0a8f9a0f1 Mon Sep 17 00:00:00 2001 From: Jonathan Wiemers Date: Mon, 13 Nov 2023 15:44:11 +0100 Subject: [PATCH 2/2] fix version based on kubernetes version --- .../templates/deployment-mattermost-hpa.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/charts/mattermost-enterprise-edition/templates/deployment-mattermost-hpa.yaml b/charts/mattermost-enterprise-edition/templates/deployment-mattermost-hpa.yaml index e20bc266..1a60f6f2 100644 --- a/charts/mattermost-enterprise-edition/templates/deployment-mattermost-hpa.yaml +++ b/charts/mattermost-enterprise-edition/templates/deployment-mattermost-hpa.yaml @@ -1,5 +1,9 @@ {{- if .Values.mattermostApp.autoscaling.enabled }} +{{- if semverCompare ">= 1.25-0" .Capabilities.KubeVersion.Version }} apiVersion: autoscaling/v2 +{{ else }} +apiVersion: autoscaling/v2beta1 +{{ end }} kind: HorizontalPodAutoscaler metadata: labels: