libreoffice-online/kubernetes/helm/collabora-online/templates/hpa.yaml
Pranam Lashkari 4ec648ae1c kubernetes: introduced kubernetes configuration
updated the instructions to setup online in kubernetes

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Ic01d94d095eac9dba54a09351eabcbc6ba83c16b
2021-05-20 12:14:19 +02:00

33 lines
1 KiB
YAML

{{- if .Values.global.app.scaling.enabled }}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Values.hpa.name }}
namespace: {{ .Values.namespace.collabora }}
labels:
app: {{ template "name" . }}
chart: {{ template "chartname" . }}
release: {{ .Release.Name }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ default .Values.global.app.name .Values.deployment.name }}
{{- if gt .Values.global.app.scaling.min 1.0 }}
minReplicas: {{ .Values.global.app.scaling.min }}
{{- end }}
maxReplicas: {{ .Values.global.app.scaling.max }}
metrics:
{{- if gt .Values.global.app.scaling.target.memory 1.0 }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.global.app.scaling.target.memory }}
{{- end }}
{{- if gt .Values.global.app.scaling.target.cpu 1.0 }}
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.global.app.scaling.target.cpu }}
{{- end }}
{{- end }}