[k8s] Kubernetes of Docker Desktop for Mac — Autoscaler/HPA unable to find metrics
I tried using k8s offered by Docker Desktop to do some experiment. But I found the hpa kept showing target unknown to me…

According these 2 posts: “Docker Kubernetes (Mac) — Autoscaler unable to find metrics”, “Get metrics from pod with docker for mac”. It turned out it’s the metrics-server’s problem.
You can find the latest matrics-server release here, and add “--kubelet-insecure-tls
” to the args of the Deployment configuration.
...
spec:
containers:
- args:
- --cert-dir=/tmp
- --secure-port=4443
- --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
- --kubelet-use-node-status-port
- --kubelet-insecure-tls
image: k8s.gcr.io/metrics-server/metrics-server:v0.4.4
...
And then apply it.
kubectl apply -f components.yaml
Now, your hpa can get metrics.