Cluster information
Kubernetes version: 1.12
Cloud being used: (put bare-metal if not on a public cloud) AWS
Installation method: AWS EKS
Host OS: Ubuntu
CNI and version: amazon-k8s-cni:v1.5.3
CRI and version:
metrics-server: v0.3.1
HPA doesn’t scale down to minReplicas even though metric is under target for memory and CPU. It is about 2 hours. The number of replicas is still 7.There is no pending pods. Below is the source code and hpa outputs.
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "platform.fullname" . }}
labels:
app: {{ include "platform.name" . }}
chart: {{ include "platform.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
maxReplicas: 10
minReplicas: 1
metrics:
- type: Resource
resource:
name: cpu
target:
averageUtilization: 50
type: Utilization
- type: Resource
resource:
name: memory
target:
averageUtilization: 50
type: Utilization
scaleTargetRef:
apiVersion: extensions/v1beta1
kind: Deployment
name: {{ include "platform.fullname" . }}
kubectl get hpa
NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE
platform Deployment/platform 44%/50%, 1%/50% 1 10 7 166m
kubectl describe hpa platform
Name: platform
Namespace: platform-microservices
Labels: app=platform
chart=platform-v0.0.1-dev.f7e3ebae0
heritage=Tiller
release=platform-microservices
Annotations: <none>
CreationTimestamp: Thu, 12 Dec 2019 10:28:19 -0800
Reference: Deployment/platform
Metrics: ( current / target )
resource memory on pods (as a percentage of request): 44% (473425627428m) / 50%
resource cpu on pods (as a percentage of request): 0% (9m) / 50%
Min replicas: 1
Max replicas: 10
Deployment pods: 7 current / 7 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 memory resource utilization (percentage of request)
ScalingLimited False DesiredWithinRange the desired count is within the acceptable range
Events: <none>