New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[loki-distributed] Add configurable scaling behaviour and KEDA autoscaler #2126
Comments
We had exactly the same issue. We wanted Loki to scale/downscale more steadily by tuning both the One of the problems we had is that unless we enable HPA with spec:
{{- if not .Values.distributor.autoscaling.enabled }}
replicas: {{ .Values.distributor.replicas }}
{{- end }} That's a problem when using a GitOps operator like Argo CD, because once the HPA tries to scale, Argo CD will reconcile the state setting whatever the value is in the We solved it by ignoring that field in Argo CD but it'll be nice to be able to use custom HPAs configurations or KEDA objects, and still be able to avoid defining the ignoreDifferences:
- group: apps
kind: Deployment
name: loki-distributor
namespace: loki
jsonPointers:
- /spec/replicas
- group: apps
kind: StatefulSet
name: loki-ingester
namespace: loki
jsonPointers:
- /spec/replicas
- group: apps
kind: Deployment
name: loki-querier
namespace: loki
jsonPointers:
- /spec/replicas
- group: apps
kind: Deployment
name: loki-query-frontend
namespace: loki
jsonPointers:
- /spec/replicas
syncPolicy:
syncOptions:
- RespectIgnoreDifferences=true |
- grafana#2558 - grafana#2493 - grafana#1391 - grafana#2126 Signed-off-by: Gritzko Daniel Kleiner <ext.gritzko.kleiner@dafiti.com.br>
Loki's document recommend using KEDA in querier to configure autoscaling based on Prometheus metrics. Also the default scaling behaviour is too frequent for Loki's components. I recommend adding a configurable scaling behaviour to the values and templates to make deployment more stable and flexible. Here are some of the examples I wrote:
values.yaml:
templates:
Questions are welcome.
KEDA document: https://keda.sh/docs/latest/concepts/scaling-deployments/
K8S HPA document: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#default-behavior
The text was updated successfully, but these errors were encountered: