Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use autoscaling/v2 api version if kubernetes version >= 1.23 #729

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions charts/keycloak/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta2
{{- $apiVersion := "autoscaling/v2beta2" -}}
{{- if semverCompare ">= v1.23.0-0" .Capabilities.KubeVersion.Version -}}
{{- $apiVersion = "autoscaling/v2" -}}
{{- end }}
apiVersion: {{ $apiVersion }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "keycloak.fullname" . }}
Expand All @@ -15,7 +19,7 @@ spec:
name: {{ include "keycloak.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
metrics:
{{- toYaml .Values.autoscaling.metrics | nindent 4 }}
behavior:
{{- toYaml .Values.autoscaling.behavior | nindent 4 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/keycloak/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ prometheusRule:
# severity: warning

autoscaling:
# If `true`, a autoscaling/v2beta2 HorizontalPodAutoscaler resource is created (requires Kubernetes 1.18 or above)
# If `true`, a autoscaling/v2beta2 or autoscaling/v2 HorizontalPodAutoscaler resource is created (requires Kubernetes 1.18 or 1.23 or above)
# Autoscaling seems to be most reliable when using KUBE_PING service discovery (see README for details)
# This disables the `replicas` field in the StatefulSet
enabled: false
Expand Down
Loading