1

I am trying to use Prometheus for monitoring my EKS Fargate (k8s ver.: 1.23). So far I followed the procedure from https://aws.amazon.com/blogs/containers/monitoring-amazon-eks-on-aws-fargate-using-prometheus-and-grafana/ and https://devopscube.com/setup-prometheus-monitoring-on-kubernetes/. Right now I only received the metrics from "kube-state-metrics", but failed to get the resource usage and performance data.

Besides, I got "Error from server (NotFound): the server could not find the requested resource" when I run kubectl get --raw /metrics, kubectl get --raw /api/v1/nodes/${NODE_NAME}/proxy/metrics/cadvisor

Anyone knows the reason why I got Error from server (NotFound)? How can I fix it?

Thank you!

Andrew
  • 129
  • 2
  • 8

1 Answers1

0

Solution for Windows/GitBash

If you use GitBash on Windows the POSIX-to-Windows path conversion might be the cause of this problem. Using a starting double slash should be a quick fix: kubectl get --raw //metrics, see also: Turn off git path resolution in commit message

How it can be found

Raising the verbosity level of kubectl can help to find the problem: kubectl get --raw /metrics -v 10. In my setup (Windows, GitBash, GCP), these are the first lines of the response without using the double slash trick:

Config loaded from file:  C:\Users\...\.kube\config
curl -v -XGET  -H "Accept: application/json, */*" -H "User-Agent: kubectl.exe/v1.25.9 (windows/amd64) kubernetes/..." 'https://x.x.x.x/Program%20Files/Git/metrics'
GET https://x.x.x.x/Program%20Files/Git/metrics 404 Not Found in 28 milliseconds

In this case, the unexpected Program%20Files/Git/ part in the URL gives the hint that the / is getting converted.

balage
  • 51
  • 1
  • 2
  • 3