根据 HTTP 请求率,我对 HPA 配置有疑问。我正在使用基于 Prometheus 指标的速率sum(rate(http_server_requests_seconds_count[5m]))
- 但在启动时,HPA 会自动缩放到最大数量的 pod,尽管没有收到 HTTP 请求。请参阅下面 kubectl describe hpa 的摘录,显示它正在根据指标进行扩展,这发生在部署后的几秒钟内。
Normal SuccessfulRescale 23m (x4 over 128m) horizontal-pod-autoscaler New size: 2; reason: pods metric rate_5m_http_server_requests_seconds_count above target
Normal SuccessfulRescale 23m (x4 over 128m) horizontal-pod-autoscaler New size: 3; reason: pods metric rate_5m_http_server_requests_seconds_count above target
是否可以告诉 Kubernetes 在前 N 秒/分钟内不要进行扩展,或者是否有其他方法可以解决这个问题?