HPA not working in Mac docker-desktop

I found errors when I try to apply HPA in Mac docker-desktop. It cause by metrics-server.

Solution

helm install my-metrics-server --set "args={--kubelet-insecure-tls}" stable/metrics-server --namespace kube-system

Problems

the server could not find the requested resource (get services http:heapster:)

ScalingActive False FailedGetResourceMetric the HPA was unable to compute the replica count: unable to get metrics for resource cpu: no metrics returned from resource metrics API

Warning FailedGetResourceMetric 9m49s (x160 over 73m) horizontal-pod-autoscaler unable to get metrics for resource cpu: unable to fetch metrics from resource metrics API: the server could not find the requested resource (get pods.metrics.k8s.io)
Warning FailedComputeMetricsReplicas 5m1s (x179 over 73m) horizontal-pod-autoscaler failed to get cpu utilization: unable to get metrics for resource cpu: unable to fetch metrics from resource metrics API: the server could not find the requested
$ kubectl top pods --all-namespaces
Error from server (NotFound): the server could not find the requested resource (get services http:heapster:)
$ kubectl top nodes
Error from server (NotFound): the server could not find the requested resource (get services http:heapster:)

Reference