Adding dependencies, binary autostart
This commit is contained in:
50
opencloud/charts/loki/templates/backend/hpa.yaml
Normal file
50
opencloud/charts/loki/templates/backend/hpa.yaml
Normal file
@@ -0,0 +1,50 @@
|
||||
{{- $isSimpleScalable := eq (include "loki.deployment.isScalable" .) "true" -}}
|
||||
{{- $autoscalingv2 := .Capabilities.APIVersions.Has "autoscaling/v2" -}}
|
||||
{{- if and $isSimpleScalable (not .Values.read.legacyReadTarget ) ( .Values.backend.autoscaling.enabled ) }}
|
||||
{{- if $autoscalingv2 }}
|
||||
apiVersion: autoscaling/v2
|
||||
{{- else }}
|
||||
apiVersion: autoscaling/v2beta1
|
||||
{{- end }}
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ include "loki.backendFullname" . }}
|
||||
labels:
|
||||
{{- include "loki.backendLabels" . | nindent 4 }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
name: {{ include "loki.backendFullname" . }}
|
||||
minReplicas: {{ .Values.backend.autoscaling.minReplicas }}
|
||||
maxReplicas: {{ .Values.backend.autoscaling.maxReplicas }}
|
||||
{{- with .Values.backend.autoscaling.behavior }}
|
||||
behavior:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
metrics:
|
||||
{{- with .Values.backend.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
{{- if $autoscalingv2 }}
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ . }}
|
||||
{{- else }}
|
||||
targetAverageUtilization: {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Values.backend.autoscaling.targetCPUUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
{{- if $autoscalingv2 }}
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ . }}
|
||||
{{- else }}
|
||||
targetAverageUtilization: {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user