mirror of
https://github.com/fluxcd/flagger.git
synced 2026-02-14 18:10:00 +00:00
36 lines
899 B
YAML
36 lines
899 B
YAML
{{- if .Values.hpa.enabled -}}
|
|
apiVersion: autoscaling/v2
|
|
kind: HorizontalPodAutoscaler
|
|
metadata:
|
|
name: {{ template "podinfo.fullname" . }}
|
|
labels:
|
|
app: {{ template "podinfo.name" . }}
|
|
chart: {{ template "podinfo.chart" . }}
|
|
release: {{ .Release.Name }}
|
|
heritage: {{ .Release.Service }}
|
|
spec:
|
|
scaleTargetRef:
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
name: {{ template "podinfo.fullname" . }}
|
|
minReplicas: {{ .Values.hpa.minReplicas }}
|
|
maxReplicas: {{ .Values.hpa.maxReplicas }}
|
|
metrics:
|
|
{{- if .Values.hpa.cpu }}
|
|
- type: Resource
|
|
resource:
|
|
name: cpu
|
|
target:
|
|
type: Utilization
|
|
averageUtilization: {{ .Values.hpa.cpu }}
|
|
{{- end }}
|
|
{{- if .Values.hpa.memory }}
|
|
- type: Resource
|
|
resource:
|
|
name: memory
|
|
target:
|
|
type: AverageValue
|
|
averageValue: {{ .Values.hpa.memory }}
|
|
{{- end }}
|
|
{{- end }}
|