New batchZero to DevOps starts 29 Nov · limited seatsReserve your seat
Cheat sheetsKubernetesKubernetes
FreeSheet 01 of 16

Cluster Info & Resource Listing

A comprehensive developer cheatsheet covering Kubernetes cluster inspection and resource listing with kubectl, featuring essential CLI commands, common flags, and operational workflows for displaying cluster endpoints, listing resources across namespaces, describing resource details, and exploring available API resources.

Table of Contents


kubectl cluster-info — Display Cluster Info

Shows cluster endpoint information.

Basic Usage

bash
$ kubectl cluster-info
Kubernetes control plane is running at https://my-cluster.example.com
CoreDNS is running at https://my-cluster.example.com/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

Dump Cluster Info

Dump all cluster info:

bash
$ kubectl cluster-info dump

Dump to file:

bash
$ kubectl cluster-info dump > cluster-dump.txt

Dump specific namespace:

bash
$ kubectl cluster-info dump --namespace=kube-system

kubectl get — List Resources

Lists one or more resources.

Basic Usage

bash
$ kubectl get pods
NAME                     READY   STATUS    RESTARTS   AGE
nginx-7b8b9c6d8f-abc12   1/1     Running   0          5d
redis-5c8b9c6d8f-def34   1/1     Running   0          3d
app-6d8b9c6d8f-ghi56     0/1     Pending   0          1h

Common Resource Types

ResourceShortPurpose
podspoList pods
servicessvcList services
deploymentsdeployList deployments
nodesnoList nodes
namespacesnsList namespaces
configmapscmList config maps
secrets-List secrets
ingressesingList ingresses
persistentvolumespvList PVs
persistentvolumeclaimspvcList PVCs
statefulsetsstsList statefulsets
daemonsetsdsList daemonsets
jobs-List jobs
cronjobscjList cronjobs

Common Flags

FlagPurpose
-n namespaceFilter by namespace
-AAll namespaces
-o wideShow more details (IPs, nodes)
-o yamlOutput as YAML
-o jsonOutput as JSON
-wWatch for changes
-l app=nginxLabel selector

Examples

Get pods with more details:

bash
$ kubectl get pods -o wide
NAME                     READY   STATUS    RESTARTS   AGE   IP           NODE
nginx-7b8b9c6d8f-abc12   1/1     Running   0          5d    10.0.1.100   node-1

Get all resources in a namespace:

bash
$ kubectl get all -n production

Get multiple resources:

bash
$ kubectl get pods,svc,deployments -n production

Get nodes with labels:

bash
$ kubectl get nodes --show-labels

Watch pods in real-time:

bash
$ kubectl get pods -w

Get pods with a label selector:

bash
$ kubectl get pods -l app=nginx

Get pods in YAML format:

bash
$ kubectl get pod nginx -o yaml

Get pods in JSON format (for scripting):

bash
$ kubectl get pod nginx -o json | jq '.status.phase'

kubectl describe — Show Resource Details

Shows detailed information about a resource.

Basic Usage

bash
$ kubectl describe pod nginx-7b8b9c6d8f-abc12
Name:             nginx-7b8b9c6d8f-abc12
Namespace:        default
Priority:         0
Service Account:  default
Node:             node-1/192.168.1.10
Start Time:       Mon, 15 Jan 2026 10:30:15 +0000
Labels:           app=nginx
                  pod-template-hash=7b8b9c6d8f
Status:           Running
IP:               10.0.1.100
Controlled By:    ReplicaSet/nginx-7b8b9c6d8f
Containers:
  nginx:
    Container ID:   docker://abc123
    Image:          nginx:latest
    State:          Running
      Started:      Mon, 15 Jan 2026 10:30:20 +0000
    Ready:          True
    Restart Count:  0
Conditions:
  Type              Status
  Initialized       True
  Ready             True
  ContainersReady   True
  PodScheduled      True
Events:
  Type    Reason     Age   From               Message
  ----    ------     ----  ----               -------
  Normal  Scheduled  5d    default-scheduler  Successfully assigned default/nginx-7b8b9c6d8f-abc12 to node-1
  Normal  Pulling    5d    kubelet            Pulling image "nginx:latest"
  Normal  Pulled     5d    kubelet            Successfully pulled image "nginx:latest"
  Normal  Created    5d    kubelet            Created container nginx
  Normal  Started    5d    kubelet            Started container nginx

Common Uses

Describe a pod:

bash
$ kubectl describe pod my-pod

Describe a service:

bash
$ kubectl describe svc my-service

Describe a deployment:

bash
$ kubectl describe deploy my-deployment

Describe a node:

bash
$ kubectl describe node node-1

Describe with namespace:

bash
$ kubectl describe pod my-pod -n production

kubectl api-resources — List API Resources

Lists all available API resources in the cluster.

Basic Usage

bash
$ kubectl api-resources
NAME                              SHORTNAMES   APIVERSION                     NAMESPACED   KIND
bindings                                       v1                             true         Binding
componentstatuses                 cs           v1                             false        ComponentStatus
configmaps                        cm           v1                             true         ConfigMap
endpoints                         ep           v1                             true         Endpoints
events                            ev           v1                             true         Event
limitranges                       limits       v1                             true         LimitRange
namespaces                        ns           v1                             false        Namespace
nodes                             no           v1                             false        Node
persistentvolumeclaims            pvc          v1                             true         PersistentVolumeClaim
persistentvolumes                 pv           v1                             false        PersistentVolume
pods                              po           v1                             true         Pod
podtemplates                                   v1                             true         PodTemplate
replicationcontrollers            rc           v1                             true         ReplicationController
resourcequotas                    quota        v1                             true         ResourceQuota
secrets                                        v1                             true         Secret
serviceaccounts                   sa           v1                             true         ServiceAccount
services                          svc          v1                             true         Service

Common Flags

FlagPurpose
--namespaced=trueShow only namespaced resources
--namespaced=falseShow only cluster-scoped resources
--verbs=listShow resources that support list

Examples

Show namespaced resources only:

bash
$ kubectl api-resources --namespaced=true

Show cluster-scoped resources only:

bash
$ kubectl api-resources --namespaced=false

Quick Reference — Most Used Commands

TaskCommand
Show cluster infokubectl cluster-info
Dump cluster infokubectl cluster-info dump
List podskubectl get pods
List pods in namespacekubectl get pods -n production
List pods in all namespaceskubectl get pods -A
List pods with detailskubectl get pods -o wide
Watch podskubectl get pods -w
Describe podkubectl describe pod my-pod
Describe deploymentkubectl describe deploy my-deployment
List all resourceskubectl get all
List nodeskubectl get nodes
List namespaceskubectl get namespaces
List API resourceskubectl api-resources

Pro Tips

  1. Use -o wide for important details: IP addresses, node names, etc.

  2. Use -w to watch resources change in real-time.

  3. describe is great for troubleshooting — shows events and status.

  4. Use -A when you don't know which namespace: kubectl get pods -A

  5. Use api-resources to discover new resources: helpful with CRDs.

  6. Check cluster health with cluster-info.

  7. Use get all to see everything in a namespace.

  8. Combine get with grep for filtering: kubectl get pods | grep Running


Next in KubernetesConfigMaps & Secrets
Kubernetes cheat sheet: Cluster Info & Resource Listing | InfraThrone DevOps Park