kubernetes Display Resource (CPU/Memory/Gpu/PodCount) Usage and Request and Limit.

kubectl resource-view

A plugin to access Kubernetes resource requests, limits, and usage.

Display Resource (CPU/Memory/Gpu/PodCount) Usage and Request and Limit.

The resource command allows you to see the resource consumption for nodes or pods.

- This command requires Metrics Server to be correctly configured and working on the server

Installation

go install github.com/bryant-rh/kubectl-resource-view@VERSION

krew is submitting PR, and it is still being approved. After approval, it can be installed in the following way

Use krew plugin manager to instal:

kubectl krew install resource-view
kubectl resource-view --help

Usage

$ kubectl resource-view -h  # or kubectl-resource-view -h
Display Resource (cpu/memory/gpu/podcount) Usage and Request and Limit.

 The resource command allows you to see the resource consumption for nodes or pods.

 This command requires Metrics Server to be correctly configured and working on the server.

Usage:
  kubectl-resource-view [flags] [options]
  kubectl-resource-view [command]

Examples:
  node        Display Resource (cpu/memory/gpu/podcount) usage of nodes
  pod         Display Resource (cpu/memory/gpu)          usage of pods

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  node        Display resource (cpu/memory/gpu/podcount) usage of nodes
  pod         Display resource (cpu/memory/gpu) usage of pods

node

$ kubectl resource-view node -h  # or kubectl-resource-view node -h
Display resource (cpu/memory/gpu/podcount) usage of nodes.

 The resource node command allows you to see the resource consumption of nodes.

Usage:
  kubectl-resource-view node [NAME | -l label]

Aliases:
  node, nodes, no

Examples:
  # Show metrics for all nodes
  kubectl resource-view node

  # Show metrics for a given node
  kubectl resource-view node NODE_NAME

  # Show metrics for the node defined by type name=cpu,memory,gpu,pod
  kubectl resource-view node -t cpu,memory,gpu,pod

Flags:
  -h, --help              help for node
      --no-format         If present, print output without format table
  -l, --selector string   Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
      --sort-by string    If non-empty, sort nodes list using specified field. The field can be either 'cpu' or 'memory'
  -t, --type string       Type information hierarchically (default: All Type)[possible values: cpu,memory,pod,gpu], Multiple can be specified, separated by commas

pod

$ kubectl resource-view pod -h  # or kubectl-resource-view  pod -h
Display resource (cpu/memory/gpu) usage of pods.

 The 'resource-view pod' command allows you to see the resource consumption of pods.

 Due to the metrics pipeline delay, they may be unavailable for a few minutes since pod creation.

Usage:
  kubectl-resource-view pod [NAME | -l label]

Aliases:
  pod, pods, po

Examples:
  # Show metrics for all pods in the default namespace
  kubectl resource-view pod

  # Show metrics for all pods in the given namespace
  kubectl resource-view pod --namespace=NAMESPACE

  # Show metrics for a given pod
  kubectl resource-view pod POD_NAME

  # Show metrics for the pods defined by label name=myLabel
  kubectl resource-view pod -l name=myLabel

  # Show metrics for the pods defined by type name=cpu,memory,gpu
  kubectl resource-view pod -t cpu,memory,gpu

Flags:
  -A, --all-namespaces          If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.
      --field-selector string   Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.
  -h, --help                    help for pod
      --no-format               If present, print output without format table
  -l, --selector string         Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
      --sort-by string          If non-empty, sort pods list using specified field. The field can be either 'cpu' or 'memory'.
  -t, --type string             Type information hierarchically (default: All Type)[possible values: cpu,memory,gpu],Multiple can be specified, separated by commas

Demo

node

Show aggregate resource requests and limits and pods Capacity. This is the same information displayed by kubectl describe nodes but in a easier to view format.

+ When the percentage of cpu request and memory request is greater than 90, it will be marked in yellow, and if it is greater than 95, it will be marked in red

Example (node):

example Kubernetes node

Example (Only display one of the data of the cpu or memroy or pod or gpu):

-t  [cpu,memory,gpu,pod] Multiple can be specified, separated by commas

example Kubernetes node cpu or memroy or pod

Example (According to cpu use or memory use sort):

--sort-by  [cpu/memory]

example Kubernetes According to cpu use or memory use sort

Example (Support filtering by lable or by node name):

-l   key1=value1,key2=value2

example Kubernetes filtering by lable example Kubernetes filtering by node name

Example (Support similar kubectl format display):

--no-format

example Kubernetes similar kubectl format display

pod

Show aggregate resource requests and limits and pods Capacity. This is the same information displayed by kubectl describe nodes but in a easier to view format.

+ When the percentage of cpu use percent and memory use percent is greater than 90, it will be marked in yellow, and if it is greater than 95, it will be marked in red

Example (pod):

example Kubernetes pod

Example (Only display one of the data of the cpu or memroy):

-t  [cpu/memory/gpu] Multiple can be specified, separated by commas

example Kubernetes node cpu or memroy or pod

Example (According to cpu use or memory use sort):

--sort-by  [cpu/memory]

example Kubernetes According to cpu use or memory use sort

Example (Support filtering by lable or by pod name or namespace):

-l   key1=value1,key2=value2
-n   namespace name

example Kubernetes filtering by lable example Kubernetes filtering by lable example Kubernetes filtering by node name

Example (Support similar kubectl format display):

--no-format

example Kubernetes similar kubectl format display

License

Apache 2.0. See LICENSE.


This is not an official Google project.

Similar Resources

Collection of mini-programs demonstrating Kubernetes client-go usage.

Kubernetes client-go examples Collection of mini-programs covering various client-go use cases. The intention (at least so far) is to test (more or le

Jan 3, 2023

OpenDILab RL Kubernetes Custom Resource and Operator Lib

DI Orchestrator DI Orchestrator is designed to manage DI (Decision Intelligence) jobs using Kubernetes Custom Resource and Operator. Prerequisites A w

Jan 5, 2023

πŸ‘€ A Kubernetes cluster resource sanitizer

πŸ‘€ A Kubernetes cluster resource sanitizer

Popeye - A Kubernetes Cluster Sanitizer Popeye is a utility that scans live Kubernetes cluster and reports potential issues with deployed resources an

Jan 1, 2023

Helm Operator is designed to managed the full lifecycle of Helm charts with Kubernetes CRD resource.

Helm Operator Helm Operator is designed to install and manage Helm charts with Kubernetes CRD resource. Helm Operator does not create the Helm release

Aug 25, 2022

Crane (FinOps Crane) is an opensource project which manages cloud resource on Kubernetes stack, it is inspired by FinOps concepts.

Crane (FinOps Crane) is an opensource project which manages cloud resource on Kubernetes stack, it is inspired by FinOps concepts.

Crane (FinOps Crane) is an opensource project which manages cloud resource on Kubernetes stack, it is inspired by FinOps concepts. Goal of Crane is to provide an one-stop shop project to help Kubernetes users to save cloud resource usage with a rich set of functionalities.

Jan 3, 2023

Kubernetes resource manager.

Halyard Halyard is in an experimentation phase where I will will be learning a lot and changing my opinion (and APIs) very often. Halyard is a deploym

Dec 13, 2021

A Controller written in kubernetes sample-controller style which watches a custom resource named Bookstore

bookstore-sample-controller A Controller written in kubernetes sample-controller style which watches a custom resource named Bookstore. A resource cre

Jan 20, 2022

Memory-Alignment: a tool to help analyze layout of fields in struct in memory

Memory-Alignment: a tool to help analyze layout of fields in struct in memory

Memory Alignment Memory-Alignment is a tool to help analyze layout of fields in struct in memory. Usage go get github.com/vearne/mem-aligin Example p

Oct 26, 2022

Automatically create global & local Rate Limit in Istio, support EnvoyFilter versioning!

istio-ratelimit-operator Istio ratelimit operator provide an easy way to configure Global or Local Ratelimit in Istio mesh. Istio ratelimit operator a

Oct 24, 2022
CPU usage percentage is the ratio of the total time the CPU was active, to the elapsed time of the clock on your wall.

Docker-Kubernetes-Container-CPU-Utilization Implementing CPU Load goroutine requires the user to call the goroutine from the main file. go CPULoadCalc

Dec 15, 2021
nano-gpu-agent is a Kubernetes device plugin for GPU resources allocation on node.
nano-gpu-agent is a Kubernetes device plugin for GPU resources allocation on node.

Nano GPU Agent About this Project Nano GPU Agent is a Kubernetes device plugin implement for gpu allocation and use in container. It runs as a Daemons

Dec 29, 2022
Fadvisor(FinOps Advisor) is a collection of exporters which collect cloud resource pricing and billing data guided by FinOps, insight cost allocation for containers and kubernetes resource
Fadvisor(FinOps Advisor) is a collection of exporters which collect cloud resource pricing and billing data guided by FinOps, insight cost allocation for containers and kubernetes resource

[TOC] Fadvisor: FinOps Advisor fadvisor(finops advisor) is used to solve the FinOps Observalibility, it can be integrated with Crane to help users to

Jan 3, 2023
OpenAIOS vGPU scheduler for Kubernetes is originated from the OpenAIOS project to virtualize GPU device memory.
OpenAIOS vGPU scheduler for Kubernetes is originated from the OpenAIOS project to virtualize GPU device memory.

OpenAIOS vGPU scheduler for Kubernetes English version|δΈ­ζ–‡η‰ˆ Introduction 4paradigm k8s vGPU scheduler is an "all in one" chart to manage your GPU in k8

Jan 3, 2023
Terraform Provider for Azure (Resource Manager)Terraform Provider for Azure (Resource Manager)
Terraform Provider for Azure (Resource Manager)Terraform Provider for Azure (Resource Manager)

Terraform Provider for Azure (Resource Manager) Version 2.x of the AzureRM Provider requires Terraform 0.12.x and later, but 1.0 is recommended. Terra

Oct 16, 2021
Apachedist-resource - A concourse resource to track updates of an apache distribution, e.g. tomcat

Apache Distribution Resource A concourse resource that can track information abo

Feb 2, 2022
cluster-api-state-metrics (CASM) is a service that listens to the Kubernetes API server and generates metrics about the state of custom resource objects related of Kubernetes Cluster API.

Overview cluster-api-state-metrics (CASM) is a service that listens to the Kubernetes API server and generates metrics about the state of custom resou

Oct 27, 2022
gpupod is a tool to list and watch GPU pod in the kubernetes cluster.

gpupod gpupod is simple tool to list and watch GPU pod in kubernetes cluster. usage Usage: gpupod [flags] Flags: -t, --createdTime with pod c

Dec 8, 2021
A kubernetes plugin which enables dynamically add or remove GPU resources for a running Pod
A kubernetes plugin which enables dynamically add or remove GPU resources for a running Pod

GPU Mounter GPU Mounter is a kubernetes plugin which enables add or remove GPU resources for running Pods. This Introduction(In Chinese) is recommende

Jan 5, 2023
github-actions-merger is github actions that merges pull request with commit message including pull request labels.

github-actions-merger github-actions-merger is github actions that merges pull request with commit message including pull request labels. Usage Write

Dec 7, 2022