Skip to content

Commit

Permalink
improve hpa config (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
yurymuski authored Aug 13, 2023
1 parent 168e01a commit 10cdc22
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion charts/centrifugo/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: centrifugo
description: Centrifugo is a scalable real-time messaging server in language-agnostic way
version: 10.0.3
version: 11.0.0
appVersion: 5.0.2
home: https://centrifugal.dev
icon: https://centrifugal.dev/img/favicon.png
Expand Down
4 changes: 2 additions & 2 deletions charts/centrifugo/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
{{- with .Values.autoscalingTemplate }}
{{- toYaml . | nindent 2 }}
{{- end }}
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- if .Values.autoscaling.cpu.enabled }}
- type: Resource
resource:
name: cpu
Expand All @@ -33,7 +33,7 @@ spec:
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- if .Values.autoscaling.memory.enabled }}
- type: Resource
resource:
name: memory
Expand Down
17 changes: 12 additions & 5 deletions charts/centrifugo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,20 +159,27 @@ autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
cpu:
enabled: false
targetCPUUtilizationPercentage: 80
memory:
enabled: false
targetMemoryUtilizationPercentage: 80
# ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#default-behavior
behavior: {}

autoscalingTemplate: []
# Custom or additional autoscaling metrics
# ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-custom-metrics
# ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-metrics-apis
# ref: https://github.com/kubernetes-sigs/prometheus-adapter/
# - type: Pods
# pods:
# metric:
# name: centrifugo_node_num_clients
# # kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta1/namespaces/default/pods/*/hpa_custom_metric_centrifugo_node_num_clients" | jq .
# name: hpa_custom_metric_centrifugo_node_num_clients
# target:
# type: AverageValue
# averageValue: 10k
# averageValue: 10000m # NOTE: # 10000m = 10 actual metric value (10 clients)

podDisruptionBudget:
enabled: false
Expand Down

0 comments on commit 10cdc22

Please sign in to comment.