File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ description: |
77 PostgreSQL and Redis. Configurable for single-node evaluation
88 (subcharts on) and HA production (external services, existingSecret).
99type : application
10- version : 0.1.4
10+ version : 0.1.5
1111appVersion : " 0.1.0"
1212home : https://github.com/block/buzz
1313sources :
@@ -23,8 +23,8 @@ maintainers:
2323 url : https://github.com/block
2424annotations :
2525 artifacthub.io/changes : |
26- - kind: added
27- description: Optional CPU and per-pod WebSocket horizontal autoscaling for relay pods .
26+ - kind: changed
27+ description: Allow CPU-only relay autoscaling when no custom-metrics adapter is installed .
2828 artifacthub.io/license : Apache-2.0
2929
3030# Optional eval-only subcharts. Production deploys disable both and point
Original file line number Diff line number Diff line change @@ -89,16 +89,18 @@ autoscaling:
8989 minReplicas: 5
9090 maxReplicas: 15
9191 targetCPUUtilizationPercentage: 65
92+ websocketMetricEnabled: true
9293 websocketMetricName: buzz_ws_connections_active
9394 targetWebsocketConnections: 5000
9495` ` `
9596
96- CPU scaling requires Kubernetes Metrics Server. WebSocket scaling additionally
97- requires a custom-metrics adapter (for example Prometheus Adapter) configured to
98- expose the relay's `buzz_ws_connections_active` gauge as a pod metric with the
99- name in `websocketMetricName`. The chart creates the HPA but deliberately does
100- not install or configure a cluster-wide metrics adapter. Scale-down is gradual
101- by default so long-lived WebSocket connections have time to drain.
97+ CPU scaling requires Kubernetes Metrics Server. Set `websocketMetricEnabled : false`
98+ for a CPU-only HPA. WebSocket scaling additionally requires a custom-metrics
99+ adapter (for example Prometheus Adapter) configured to expose the relay's
100+ ` buzz_ws_connections_active` gauge as a pod metric with the name in
101+ ` websocketMetricName` . The chart creates the HPA but deliberately does not
102+ install or configure a cluster-wide metrics adapter. Scale-down is gradual by
103+ default so long-lived WebSocket connections have time to drain.
102104
103105# # Upgrades
104106
Original file line number Diff line number Diff line change @@ -41,8 +41,8 @@ surface at template time regardless of which manifest helm renders first.
4141 {{- if lt (.Values.autoscaling.maxReplicas | int) (.Values.autoscaling.minReplicas | int) -}}
4242 {{- fail " autoscaling.maxReplicas must be greater than or equal to autoscaling.minReplicas" -}}
4343 {{- end -}}
44- {{- if not .Values.autoscaling.websocketMetricName -}}
45- {{- fail " autoscaling.websocketMetricName is required when autoscaling. enabled=true " -}}
44+ {{- if and .Values.autoscaling.websocketMetricEnabled ( not .Values.autoscaling.websocketMetricName ) -}}
45+ {{- fail " autoscaling.websocketMetricName is required when WebSocket scaling is enabled" -}}
4646 {{- end -}}
4747{{- end -}}
4848
Original file line number Diff line number Diff line change @@ -22,11 +22,13 @@ spec:
2222 target :
2323 type : Utilization
2424 averageUtilization : {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
25+ {{- if .Values.autoscaling.websocketMetricEnabled }}
2526 - type : Pods
2627 pods :
2728 metric :
2829 name : {{ .Values.autoscaling.websocketMetricName }}
2930 target :
3031 type : AverageValue
3132 averageValue : {{ .Values.autoscaling.targetWebsocketConnections | quote }}
33+ {{- end }}
3234{{- end }}
Original file line number Diff line number Diff line change @@ -49,6 +49,22 @@ tests:
4949 path : spec.behavior.scaleDown.stabilizationWindowSeconds
5050 value : 600
5151
52+ - it : supports CPU-only autoscaling without a custom metrics adapter
53+ template : templates/hpa.yaml
54+ set :
55+ autoscaling.enabled : true
56+ autoscaling.websocketMetricEnabled : false
57+ asserts :
58+ - lengthEqual :
59+ path : spec.metrics
60+ count : 1
61+ - equal :
62+ path : spec.metrics[0].type
63+ value : Resource
64+ - equal :
65+ path : spec.metrics[0].resource.name
66+ value : cpu
67+
5268 - it : leaves Deployment replicas to the HPA and disables in-process huddle audio
5369 template : templates/deployment.yaml
5470 set :
Original file line number Diff line number Diff line change @@ -37,14 +37,15 @@ image:
3737replicaCount : 1
3838
3939# ── Autoscaling ──────────────────────────────────────────────────────────────
40- # Requires Metrics Server for CPU and a custom-metrics adapter exposing the
41- # pod-level Prometheus gauge named by websocketMetricName. Kubernetes HPA uses
42- # the larger replica recommendation, so either CPU or WebSocket load scales out .
40+ # Requires Metrics Server for CPU. Optional WebSocket scaling additionally
41+ # requires a custom-metrics adapter exposing its pod-level Prometheus gauge.
42+ # Kubernetes HPA uses the larger replica recommendation from enabled metrics .
4343autoscaling :
4444 enabled : false
4545 minReplicas : 5
4646 maxReplicas : 15
4747 targetCPUUtilizationPercentage : 65
48+ websocketMetricEnabled : true
4849 websocketMetricName : buzz_ws_connections_active
4950 targetWebsocketConnections : 5000
5051 behavior :
You can’t perform that action at this time.
0 commit comments