Julien Chen

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.

--

--

Recently I am trying to ship some springboot projects to kubernetes. So I chose Helm to manage my k8s setting. But when I tried to use Helm to install my chart. I kept getting connection refused error. I stuck on this problem for a long time…

connection refused warning

Turns out embedded Tomcat of Springboot only listen localhost(127.0.0.1)

After add the below setting to application.properties, the problem was solved.

server.address=0.0.0.0

P.S. Besides the above setting, please check if your API return HTTP status code or not. Liveness/Readiness probes can get health is according 400>HTTP status code ≥200. Not if you API have response or not.

--

--