Improve HPA (#354)
* Use `autoscaling/v2` if Kubernetes version >= 1.23 Signed-off-by: Atkins Chang <atkinschang@gmail.com> * Disable replicas when autoscaling enabled Signed-off-by: Atkins Chang <atkinschang@gmail.com> --------- Signed-off-by: Atkins Chang <atkinschang@gmail.com>
This commit is contained in:
parent
f8ad65066e
commit
b30eb6fff8
@ -18,7 +18,11 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
{{- if .Values.broker.autoscaling.enabled }}
|
{{- if .Values.broker.autoscaling.enabled }}
|
||||||
|
{{- if (semverCompare "<1.23-0" .Capabilities.KubeVersion.Version) }}
|
||||||
apiVersion: autoscaling/v2beta2
|
apiVersion: autoscaling/v2beta2
|
||||||
|
{{- else }}
|
||||||
|
apiVersion: autoscaling/v2
|
||||||
|
{{- end }}
|
||||||
kind: HorizontalPodAutoscaler
|
kind: HorizontalPodAutoscaler
|
||||||
metadata:
|
metadata:
|
||||||
name: "{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}"
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}"
|
||||||
|
|||||||
@ -28,7 +28,9 @@ metadata:
|
|||||||
component: {{ .Values.broker.component }}
|
component: {{ .Values.broker.component }}
|
||||||
spec:
|
spec:
|
||||||
serviceName: "{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}"
|
serviceName: "{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}"
|
||||||
|
{{- if not .Values.broker.autoscaling.enabled }}
|
||||||
replicas: {{ .Values.broker.replicaCount }}
|
replicas: {{ .Values.broker.replicaCount }}
|
||||||
|
{{- end }}
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
{{- include "pulsar.matchLabels" . | nindent 6 }}
|
{{- include "pulsar.matchLabels" . | nindent 6 }}
|
||||||
|
|||||||
@ -18,7 +18,11 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
{{- if .Values.proxy.autoscaling.enabled }}
|
{{- if .Values.proxy.autoscaling.enabled }}
|
||||||
|
{{- if (semverCompare "<1.23-0" .Capabilities.KubeVersion.Version) }}
|
||||||
apiVersion: autoscaling/v2beta2
|
apiVersion: autoscaling/v2beta2
|
||||||
|
{{- else }}
|
||||||
|
apiVersion: autoscaling/v2
|
||||||
|
{{- end }}
|
||||||
kind: HorizontalPodAutoscaler
|
kind: HorizontalPodAutoscaler
|
||||||
metadata:
|
metadata:
|
||||||
name: "{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}"
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}"
|
||||||
|
|||||||
@ -28,7 +28,9 @@ metadata:
|
|||||||
component: {{ .Values.proxy.component }}
|
component: {{ .Values.proxy.component }}
|
||||||
spec:
|
spec:
|
||||||
serviceName: "{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}"
|
serviceName: "{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}"
|
||||||
|
{{- if not .Values.proxy.autoscaling.enabled }}
|
||||||
replicas: {{ .Values.proxy.replicaCount }}
|
replicas: {{ .Values.proxy.replicaCount }}
|
||||||
|
{{- end }}
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
{{- include "pulsar.matchLabels" . | nindent 6 }}
|
{{- include "pulsar.matchLabels" . | nindent 6 }}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user