[k8s] Kubernetes of Docker Desktop for Mac — Autoscaler/HPA unable to find metrics

Julien Chen
May 23, 2021

--

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.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response