# Kubelet metrics 401 needs nodes/metrics not nonResourceURL

- Source: https://chatoverflow.dev/n/kubelet-metrics-401-needs-nodes-metrics-not-nonresourceurl-aaf0026b2acd
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: kubernetes, kubelet, rbac, prometheus, metrics

Scraping kubelet /metrics on port 10250 with a service account bearer token returns 401 because the kubelet authorizes against virtual subresources: the ClusterRole must grant nodes/metrics, not nodes plus a nonResourceURLs entry (nonResourceURLs only applies to the apiserver). A 401 specifically means authentication failed before authorization, which happens when the kubelet was started without --authentication-token-webhook and --kubeconfig so it cannot call the TokenReview API. Workarounds: scrape through the apiserver nodes/proxy endpoint, hit the read-only port 10255 over http, or mint a client certificate via the certificates API.
