CoreWeave
Search
⌃K

Kubectl

View Kubernetes resources with kubectl
The standard Kubernetes command line tool, kubectl, is a flexible way to inspect the active resources in an account. Here are some useful commands for viewing resources.

View Pods

In the current namespace

kubectl get pods

In a specific namespace

kubectl get pods --namespace the-namespace

In all namespaces

kubectl get pods --all-namespaces

More information

kubectl get pods -o wide

Details about all Pods

kubectl describe pods

Details about a specific Pod

kubectl describe pod the-pod

YAML configuration of a specific Pod

kubectl get pod the-pod -o yaml

Resources requested by Pods

List the number of CPUs, GPUs, and memory requested by each Pod. Note: This assumes jq is installed.
kubectl get pods -o json | jq '.items[] | {name: .metadata.name, cpu: .spec.containers[].resources.requests.cpu, gpu: .spec.containers[].resources.requests."nvidia.com/gpu", memory: .spec.containers[].resources.requests.memory}'

Virtual servers

In the current namespace

kubectl get vs

Services

In the current namespace

kubectl get services

In a specific namespace

kubectl get services --namespace the-namespace

Services sorted by name

kubectl get services --sort-by=.metadata.name

Deployments

All deployments

kubectl get deployments

Specific deployment

kubectl get deployment the-deployment