mirror of
https://github.com/bokysan/docker-postfix.git
synced 2025-09-05 22:14:26 +08:00
36 lines
1.3 KiB
YAML
36 lines
1.3 KiB
YAML
{{- if .Values.autoscaling.enabled }}
|
|
{{- $chart := "mail" -}}
|
|
{{- $fullName := include (print $chart ".fullname") . -}}
|
|
{{- $labels := include (print $chart ".labels") . -}}
|
|
{{- $kind := "StatefulSet" -}}
|
|
apiVersion: {{ .Values.autoscaling.apiVersion }}
|
|
kind: HorizontalPodAutoscaler
|
|
metadata:
|
|
name: {{ $fullName | quote }}
|
|
namespace: {{ .Release.Namespace | quote }}
|
|
labels:
|
|
{{- $labels | nindent 4 }}
|
|
{{- with .Values.autoscaling.labels }}{{ toYaml . | nindent 4 }}{{ end }}
|
|
annotations:
|
|
{{- with .Values.autoscaling.annotations }}{{ toYaml . | nindent 4 }}{{ end }}
|
|
spec:
|
|
scaleTargetRef:
|
|
apiVersion: apps/v1
|
|
kind: {{ $kind | quote }}
|
|
name: {{ $fullName | quote }}
|
|
minReplicas: {{ .Values.autoscaling.minReplicas }}
|
|
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
|
|
metrics:
|
|
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
|
|
- type: Resource
|
|
resource:
|
|
name: cpu
|
|
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
|
|
{{- end }}
|
|
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
|
- type: Resource
|
|
resource:
|
|
name: memory
|
|
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
|
{{- end }}
|
|
{{- end }}
|