Add Default backend HPA autoscaling.
This commit is contained in:
parent
6c729e9cc7
commit
ab9ba3e970
6 changed files with 44 additions and 7 deletions
29
charts/ingress-nginx/templates/default-backend-hpa.yaml
Normal file
29
charts/ingress-nginx/templates/default-backend-hpa.yaml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{{- if .Values.defaultBackend.autoscaling.enabled }}
|
||||
apiVersion: autoscaling/v2beta1
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "ingress-nginx.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: default-backend
|
||||
name: {{ template "nginx-ingress.defaultBackend.fullname" . }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: {{ template "deployment.apiVersion" . }}
|
||||
kind: Deployment
|
||||
name: {{ template "nginx-ingress.defaultBackend.fullname" . }}
|
||||
minReplicas: {{ .Values.defaultBackend.autoscaling.minReplicas }}
|
||||
maxReplicas: {{ .Values.defaultBackend.autoscaling.maxReplicas }}
|
||||
metrics:
|
||||
{{- with .Values.defaultBackend.autoscaling.targetCPUUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
targetAverageUtilization: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .Values.defaultBackend.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
targetAverageUtilization: {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue