A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/ahmetb/kubectl-node_resource below:

ahmetb/kubectl-node_resource: Query node allocations/utilizations in kubectl

kubectl node-resource is a kubectl plugin that provides insights into Kubernetes node resource allocation (based on pod requests) and actual utilization (based on metrics-server data).

It helps administrators and developers understand how resources are being consumed across their cluster's nodes and node pools.

If you have Krew installed, you can install node-resource with the following command:

kubectl krew install node-resource

This plugin offers two main subcommands:

Displays the resource allocation on nodes based on the sum of pod resource requests. It shows each node's allocatable CPU and memory, the sum of CPU and memory requests from pods running on them, and the percentage of allocatable resources requested.

Examples:

Usage Command Show allocation for all nodes, sorted by CPU percentage (default sort).
kubectl node-resource allocation
Show allocation for nodes with the label role=worker, and also display host ports used by containers on these nodes.
kubectl node-resource allocation "role=worker" \
	--show-host-ports
Show only the summary of allocation for nodes matching the label pool=high-memory, hiding the detailed table.
kubectl node-resource allocation "pool=high-memory" \
	--summary=only
Show allocation for a specific node named node1, sorted by memory percentage, and include free (allocatable - requested) resources.
kubectl node-resource allocation \
      "kubernetes.io/hostname=node1" \
	--sort-by=mem-percent \
	--show-free

Both allocation and utilization commands support flags to control which resource details are displayed:

The allocation command additionally supports:

These flags allow you to tailor the output to focus on the specific resources you are interested in. For example, to see only memory, ephemeral storage, and GPU (using the default key) for allocations:

kubectl node-resource allocation --show-cpu=false --show-memory --show-ephemeral-storage --show-gpu

For example, to show AMD GPUs, run:

kubectl node-resource allocation --show-gpu --gpu-resource-key=amd.com/gpu

Displays the actual resource utilization of nodes, similar to kubectl top node. It shows each node's allocatable CPU and memory, the actual CPU and memory currently used, and the percentage of allocatable resources utilized. This command requires the Kubernetes metrics-server to be installed and running in the cluster.

Examples:

Usage Command Show utilization for all nodes, sorted by CPU percentage (default sort).
kubectl node-resource utilization
Show utilization for nodes with the label role=worker.
kubectl node-resource utilization "role=worker"
Show utilization and include a column for free (allocatable - used) resources.
kubectl node-resource utilization \
	--show-free
Show utilization for all nodes, sorted by memory percentage, and output in JSON format.
kubectl node-resource utilization \
	--sort-by=mem-percent \
	--json

This project is licensed under the Apache 2.0 License. See the LICENSE.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4