LAB09: Fetching Kubelet Metrics
LAB 20.1: Fetching Kubelet metric endpoint
STEP 0 — Start the Proxy (required)
kubectl proxy --port=8001http://127.0.0.1:8001/STEP 1 — List All Nodes (raw JSON)
curl -s http://127.0.0.1:8001/api/v1/nodes | jqOnly print node names:
curl -s http://127.0.0.1:8001/api/v1/nodes \
| jq -r '.items[].metadata.name'k8s-cluster-m1
k8s-cluster-w1
k8s-cluster-w2STEP 2 — KUBELET SUMMARY METRICS (MAIN ENTRYPOINT)
Replace <node> with one from above:
<node> with one from above:STEP 3 — List Pods on That Node (from kubelet)
STEP 4 — cAdvisor Metrics (raw Prometheus-style)
STEP 5 — Kubelet Internal Metrics
STEP 6 — Resource Metrics (new endpoint)
STEP 7 — Kubelet Health Endpoints
Live
Subsystems:
STEP 8 — Get Container Logs Directly via Kubelet
STEP 9 — Direct Logs of Kubelet (if exposed)
STEP 10 — FULL MENU of Kubelet Endpoints
Endpoint
Purpose
Correct usage: You must get one of the API resources in that group
1. Get node metrics
2. Get pod metrics
3. Get schema via explain
Helpful Table (This will make everything click)
What you type
What it is
Valid?
Final working commands
All node metrics:
All pod metrics:
Raw JSON:
PreviousBLOG09: How Metric Server WorksNextBLOG09a: Tiny Toy Application—A Pocket-Sized Traffic Booth
Last updated