Skip to content

Commit

Permalink
Merge pull request #2489 from javiplx/feature/hpa_behaviour
Browse files Browse the repository at this point in the history
[loki-distributed] Add behaviours to hpa
  • Loading branch information
zanhsieh authored Jul 25, 2023
2 parents 15791e4 + 1490423 commit af6676f
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/loki-distributed/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: loki-distributed
description: Helm chart for Grafana Loki in microservices mode
type: application
appVersion: 2.8.2
version: 0.70.1
version: 0.70.2
home: https://grafana.github.io/helm-charts
sources:
- https://github.com/grafana/loki
Expand Down
17 changes: 16 additions & 1 deletion charts/loki-distributed/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# loki-distributed

![Version: 0.70.1](https://img.shields.io/badge/Version-0.70.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.8.2](https://img.shields.io/badge/AppVersion-2.8.2-informational?style=flat-square)
![Version: 0.70.2](https://img.shields.io/badge/Version-0.70.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.8.2](https://img.shields.io/badge/AppVersion-2.8.2-informational?style=flat-square)

Helm chart for Grafana Loki in microservices mode

Expand Down Expand Up @@ -109,6 +109,9 @@ kubectl delete statefulset RELEASE_NAME-loki-distributed-querier -n LOKI_NAMESPA
| distributor.affinity | string | Hard node and soft zone anti-affinity | Affinity for distributor pods. Passed through `tpl` and, thus, to be configured as string |
| distributor.appProtocol | object | `{"grpc":""}` | Adds the appProtocol field to the distributor service. This allows distributor to work with istio protocol selection. |
| distributor.appProtocol.grpc | string | `""` | Set the optional grpc service protocol. Ex: "grpc", "http2" or "https" |
| distributor.autoscaling.behavior.enabled | bool | `false` | Enable autoscaling behaviours |
| distributor.autoscaling.behavior.scaleDown | object | `{}` | define scale down policies, must conform to HPAScalingRules |
| distributor.autoscaling.behavior.scaleUp | object | `{}` | define scale up policies, must conform to HPAScalingRules |
| distributor.autoscaling.enabled | bool | `false` | Enable autoscaling for the distributor |
| distributor.autoscaling.maxReplicas | int | `3` | Maximum autoscaling replicas for the distributor |
| distributor.autoscaling.minReplicas | int | `1` | Minimum autoscaling replicas for the distributor |
Expand Down Expand Up @@ -136,6 +139,9 @@ kubectl delete statefulset RELEASE_NAME-loki-distributed-querier -n LOKI_NAMESPA
| distributor.tolerations | list | `[]` | Tolerations for distributor pods |
| fullnameOverride | string | `nil` | Overrides the chart's computed fullname |
| gateway.affinity | string | Hard node and soft zone anti-affinity | Affinity for gateway pods. Passed through `tpl` and, thus, to be configured as string |
| gateway.autoscaling.behavior.enabled | bool | `false` | Enable autoscaling behaviours |
| gateway.autoscaling.behavior.scaleDown | object | `{}` | define scale down policies, must conform to HPAScalingRules |
| gateway.autoscaling.behavior.scaleUp | object | `{}` | define scale up policies, must conform to HPAScalingRules |
| gateway.autoscaling.enabled | bool | `false` | Enable autoscaling for the gateway |
| gateway.autoscaling.maxReplicas | int | `3` | Maximum autoscaling replicas for the gateway |
| gateway.autoscaling.minReplicas | int | `1` | Minimum autoscaling replicas for the gateway |
Expand Down Expand Up @@ -233,6 +239,9 @@ kubectl delete statefulset RELEASE_NAME-loki-distributed-querier -n LOKI_NAMESPA
| ingester.affinity | string | Hard node and soft zone anti-affinity | Affinity for ingester pods. Passed through `tpl` and, thus, to be configured as string |
| ingester.appProtocol | object | `{"grpc":""}` | Adds the appProtocol field to the ingester service. This allows ingester to work with istio protocol selection. |
| ingester.appProtocol.grpc | string | `""` | Set the optional grpc service protocol. Ex: "grpc", "http2" or "https" |
| ingester.autoscaling.behavior.enabled | bool | `false` | Enable autoscaling behaviours |
| ingester.autoscaling.behavior.scaleDown | object | `{}` | define scale down policies, must conform to HPAScalingRules |
| ingester.autoscaling.behavior.scaleUp | object | `{}` | define scale up policies, must conform to HPAScalingRules |
| ingester.autoscaling.enabled | bool | `false` | Enable autoscaling for the ingester |
| ingester.autoscaling.maxReplicas | int | `3` | Maximum autoscaling replicas for the ingester |
| ingester.autoscaling.minReplicas | int | `1` | Minimum autoscaling replicas for the ingester |
Expand Down Expand Up @@ -425,6 +434,9 @@ kubectl delete statefulset RELEASE_NAME-loki-distributed-querier -n LOKI_NAMESPA
| querier.affinity | string | Hard node and soft zone anti-affinity | Affinity for querier pods. Passed through `tpl` and, thus, to be configured as string |
| querier.appProtocol | object | `{"grpc":""}` | Adds the appProtocol field to the querier service. This allows querier to work with istio protocol selection. |
| querier.appProtocol.grpc | string | `""` | Set the optional grpc service protocol. Ex: "grpc", "http2" or "https" |
| querier.autoscaling.behavior.enabled | bool | `false` | Enable autoscaling behaviours |
| querier.autoscaling.behavior.scaleDown | object | `{}` | define scale down policies, must conform to HPAScalingRules |
| querier.autoscaling.behavior.scaleUp | object | `{}` | define scale up policies, must conform to HPAScalingRules |
| querier.autoscaling.enabled | bool | `false` | Enable autoscaling for the querier, this is only used if `indexGateway.enabled: true` |
| querier.autoscaling.maxReplicas | int | `3` | Maximum autoscaling replicas for the querier |
| querier.autoscaling.minReplicas | int | `1` | Minimum autoscaling replicas for the querier |
Expand Down Expand Up @@ -460,6 +472,9 @@ kubectl delete statefulset RELEASE_NAME-loki-distributed-querier -n LOKI_NAMESPA
| queryFrontend.affinity | string | Hard node and soft zone anti-affinity | Affinity for query-frontend pods. Passed through `tpl` and, thus, to be configured as string |
| queryFrontend.appProtocol | object | `{"grpc":""}` | Adds the appProtocol field to the queryFrontend service. This allows queryFrontend to work with istio protocol selection. |
| queryFrontend.appProtocol.grpc | string | `""` | Set the optional grpc service protocol. Ex: "grpc", "http2" or "https" |
| queryFrontend.autoscaling.behavior.enabled | bool | `false` | Enable autoscaling behaviours |
| queryFrontend.autoscaling.behavior.scaleDown | object | `{}` | define scale down policies, must conform to HPAScalingRules |
| queryFrontend.autoscaling.behavior.scaleUp | object | `{}` | define scale up policies, must conform to HPAScalingRules |
| queryFrontend.autoscaling.enabled | bool | `false` | Enable autoscaling for the query-frontend |
| queryFrontend.autoscaling.maxReplicas | int | `3` | Maximum autoscaling replicas for the query-frontend |
| queryFrontend.autoscaling.minReplicas | int | `1` | Minimum autoscaling replicas for the query-frontend |
Expand Down
9 changes: 9 additions & 0 deletions charts/loki-distributed/templates/distributor/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,13 @@ spec:
targetAverageUtilization: {{ . }}
{{- end }}
{{- end }}
{{- if .Values.distributor.autoscaling.behavior.enabled }}
behavior:
{{- with .Values.distributor.autoscaling.behavior.scaleDown }}
scaleDown: {{ toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.distributor.autoscaling.behavior.scaleUp }}
scaleUp: {{ toYaml . | nindent 6 }}
{{- end }}
{{- end }}
{{- end }}
9 changes: 9 additions & 0 deletions charts/loki-distributed/templates/gateway/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,13 @@ spec:
targetAverageUtilization: {{ . }}
{{- end }}
{{- end }}
{{- if .Values.gateway.autoscaling.behavior.enabled }}
behavior:
{{- with .Values.gateway.autoscaling.behavior.scaleDown }}
scaleDown: {{ toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.gateway.autoscaling.behavior.scaleUp }}
scaleUp: {{ toYaml . | nindent 6 }}
{{- end }}
{{- end }}
{{- end }}
9 changes: 9 additions & 0 deletions charts/loki-distributed/templates/ingester/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,13 @@ spec:
targetAverageUtilization: {{ . }}
{{- end }}
{{- end }}
{{- if .Values.ingester.autoscaling.behavior.enabled }}
behavior:
{{- with .Values.ingester.autoscaling.behavior.scaleDown }}
scaleDown: {{ toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.ingester.autoscaling.behavior.scaleUp }}
scaleUp: {{ toYaml . | nindent 6 }}
{{- end }}
{{- end }}
{{- end }}
9 changes: 9 additions & 0 deletions charts/loki-distributed/templates/querier/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,13 @@ spec:
targetAverageUtilization: {{ . }}
{{- end }}
{{- end }}
{{- if .Values.querier.autoscaling.behavior.enabled }}
behavior:
{{- with .Values.querier.autoscaling.behavior.scaleDown }}
scaleDown: {{ toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.querier.autoscaling.behavior.scaleUp }}
scaleUp: {{ toYaml . | nindent 6 }}
{{- end }}
{{- end }}
{{- end }}
9 changes: 9 additions & 0 deletions charts/loki-distributed/templates/query-frontend/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,13 @@ spec:
targetAverageUtilization: {{ . }}
{{- end }}
{{- end }}
{{- if .Values.queryFrontend.autoscaling.behavior.enabled }}
behavior:
{{- with .Values.queryFrontend.autoscaling.behavior.scaleDown }}
scaleDown: {{ toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.queryFrontend.autoscaling.behavior.scaleUp }}
scaleUp: {{ toYaml . | nindent 6 }}
{{- end }}
{{- end }}
{{- end }}
35 changes: 35 additions & 0 deletions charts/loki-distributed/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,13 @@ ingester:
targetCPUUtilizationPercentage: 60
# -- Target memory utilisation percentage for the ingester
targetMemoryUtilizationPercentage:
behavior:
# -- Enable autoscaling behaviours
enabled: false
# -- define scale down policies, must conform to HPAScalingRules
scaleDown: {}
# -- define scale up policies, must conform to HPAScalingRules
scaleUp: {}
image:
# -- The Docker registry for the ingester image. Overrides `loki.image.registry`
registry: null
Expand Down Expand Up @@ -486,6 +493,13 @@ distributor:
targetCPUUtilizationPercentage: 60
# -- Target memory utilisation percentage for the distributor
targetMemoryUtilizationPercentage:
behavior:
# -- Enable autoscaling behaviours
enabled: false
# -- define scale down policies, must conform to HPAScalingRules
scaleDown: {}
# -- define scale up policies, must conform to HPAScalingRules
scaleUp: {}
image:
# -- The Docker registry for the distributor image. Overrides `loki.image.registry`
registry: null
Expand Down Expand Up @@ -561,6 +575,13 @@ querier:
targetCPUUtilizationPercentage: 60
# -- Target memory utilisation percentage for the querier
targetMemoryUtilizationPercentage:
behavior:
# -- Enable autoscaling behaviours
enabled: false
# -- define scale down policies, must conform to HPAScalingRules
scaleDown: {}
# -- define scale up policies, must conform to HPAScalingRules
scaleUp: {}
image:
# -- The Docker registry for the querier image. Overrides `loki.image.registry`
registry: null
Expand Down Expand Up @@ -662,6 +683,13 @@ queryFrontend:
targetCPUUtilizationPercentage: 60
# -- Target memory utilisation percentage for the query-frontend
targetMemoryUtilizationPercentage:
behavior:
# -- Enable autoscaling behaviours
enabled: false
# -- define scale down policies, must conform to HPAScalingRules
scaleDown: {}
# -- define scale up policies, must conform to HPAScalingRules
scaleUp: {}
image:
# -- The Docker registry for the query-frontend image. Overrides `loki.image.registry`
registry: null
Expand Down Expand Up @@ -894,6 +922,13 @@ gateway:
targetCPUUtilizationPercentage: 60
# -- Target memory utilisation percentage for the gateway
targetMemoryUtilizationPercentage:
behavior:
# -- Enable autoscaling behaviours
enabled: false
# -- define scale down policies, must conform to HPAScalingRules
scaleDown: {}
# -- define scale up policies, must conform to HPAScalingRules
scaleUp: {}
# -- See `kubectl explain deployment.spec.strategy` for more,
# ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy
deploymentStrategy:
Expand Down

0 comments on commit af6676f

Please sign in to comment.