Get node metrics from metrics.k8s.io
Raw node usage from the metrics API, without kubectl top formatting
kubectl get --raw '/apis/metrics.k8s.io/v1beta1/nodes' | jq '.items[] | {name:.metadata.name, cpu:.usage.cpu, mem:.usage.memory}'
- tool
- kubectl73 commands
More kubectl commands
-
kubectl debug <pod> -n <ns> --copy-to=<pod>-dbg --share-processes --image=nicolaka/netshoot -- sleep infinityCreates a copy of the pod with a debug container in a shared PID namespace; the original pod is not touched
-
kubectl explain deploy.spec --recursive | lessPrints the full tree of nested fields; great for finding valid field names
-
kubectl rollout pause deploy/<name> -n <ns>; kubectl rollout resume deploy/<name> -n <ns>Make several edits without a rollout for each one, then resume to apply them all at once
-
kubectl apply view-last-applied deploy/<name> -n <ns> -o yamlShows the last-applied-configuration annotation, so you can compare what you meant with the live state
-
kubectl get events -A --field-selector type=Warning --sort-by=.lastTimestampCluster-wide Warning events, newest last; a fast way to find failing workloads