我们有一个基于 CPU 指标配置了 HPA 的部署。它可以正常工作几天,可以扩大和缩小 Pod。然后在某个时候,它似乎忽略了指标并扩展到一些少量的 Pod。通常我们通过手动设置可以处理流量的最小 Pod 数量来解决这个问题。一两个小时后,它再次开始扩展。这是kubectl describe hpa
自动缩放器对我们不起作用时的命令结果:
Name: my-router-hpa
Namespace: default
Labels: label1=label1
label2=label2
Annotations: <none>
CreationTimestamp: Wed, 15 Sep 2021 12:19:16 +0000
Reference: Deployment/my-router-v001
Metrics: ( current / target )
resource cpu on pods (as a percentage of request): 188% (943m) / 85%
Min replicas: 10
Max replicas: 100
Deployment pods: 10 current / 10 desired
Conditions:
Type Status Reason Message
---- ------ ------ -------
AbleToScale True ReadyForNewScale recommended size matches current size
ScalingActive True ValidMetricFound the HPA was able to successfully calculate a replica count from cpu resource utilization (percentage of request)
ScalingLimited True TooFewReplicas the desired replica count is less than the minimum replica count
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal SuccessfulRescale 60m horizontal-pod-autoscaler New size: 15; reason: cpu resource utilization (percentage of request) above target
Normal SuccessfulRescale 50m (x2 over 158m) horizontal-pod-autoscaler New size: 8; reason: cpu resource utilization (percentage of request) below target
Normal SuccessfulRescale 48m horizontal-pod-autoscaler New size: 7; reason: cpu resource utilization (percentage of request) below target
Normal SuccessfulRescale 43m (x2 over 105m) horizontal-pod-autoscaler New size: 8; reason: cpu resource utilization (percentage of request) above target
Normal SuccessfulRescale 43m horizontal-pod-autoscaler New size: 12; reason: cpu resource utilization (percentage of request) above target
Normal SuccessfulRescale 37m (x2 over 48m) horizontal-pod-autoscaler New size: 6; reason: cpu resource utilization (percentage of request) below target
Normal SuccessfulRescale 34m (x2 over 47m) horizontal-pod-autoscaler New size: 5; reason: cpu resource utilization (percentage of request) below target
Normal SuccessfulRescale 29m (x2 over 46m) horizontal-pod-autoscaler New size: 4; reason: cpu resource utilization (percentage of request) below target
Normal SuccessfulRescale 28m horizontal-pod-autoscaler New size: 2; reason: cpu resource utilization (percentage of request) below target
Normal SuccessfulRescale 16m (x2 over 106m) horizontal-pod-autoscaler New size: 1; reason: cpu resource utilization (percentage of request) below target
Normal SuccessfulRescale 15m horizontal-pod-autoscaler New size: 5; reason: cpu resource utilization (percentage of request) above target
Normal SuccessfulRescale 13m (x2 over 148m) horizontal-pod-autoscaler New size: 10; reason: cpu resource utilization (percentage of request) above target
Normal SuccessfulRescale 13m (x3 over 123m) horizontal-pod-autoscaler New size: 16; reason: cpu resource utilization (percentage of request) above target
Normal SuccessfulRescale 8m3s (x2 over 129m) horizontal-pod-autoscaler New size: 10; reason: cpu resource utilization (percentage of request) below target
它报告指标:“188%(943m)/ 85%”。但最后一个事件表明“低于目标“。
您能帮助我理解 GKE 自动扩频器的行为或建议调试它的方法吗?