Metrics Server is a scalable, efficient source of container resource metrics for Kubernetes built-in autoscaling pipelines.
These metrics will drive the scaling behavior of the deployments.
We will deploy the metrics server using Helm configured in a previous module
# create the metrics-service namespace
kubectl create namespace metrics
# deploy the metrics-server
helm install metrics-server \
stable/metrics-server \
--version 2.11.1 \
--namespace metrics
Some versions of EKS may get the following error once you create the HPA in the next step
kubectl describe hpa
To fix, set the following values for the metric-server helm release as described here
args:
- --kubelet-preferred-address-types=InternalIP
Lets’ verify the status of the metrics-server APIService (it could take several minutes)
kubectl get apiservice v1beta1.metrics.k8s.io -o yaml | yq - r 'status'
We are now ready to scale a deployed application