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
- kubectl get — List Resources
- kubectl describe — Show Resource Details
- kubectl api-resources — List API Resources
- Quick Reference — Most Used Commands
- Pro Tips
kubectl cluster-info — Display Cluster Info
Shows cluster endpoint information.
Basic Usage
$ 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:
$ kubectl cluster-info dumpDump to file:
$ kubectl cluster-info dump > cluster-dump.txtDump specific namespace:
$ kubectl cluster-info dump --namespace=kube-systemkubectl get — List Resources
Lists one or more resources.
Basic Usage
$ 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 1hCommon Resource Types
| Resource | Short | Purpose |
|---|---|---|
pods | po | List pods |
services | svc | List services |
deployments | deploy | List deployments |
nodes | no | List nodes |
namespaces | ns | List namespaces |
configmaps | cm | List config maps |
secrets | - | List secrets |
ingresses | ing | List ingresses |
persistentvolumes | pv | List PVs |
persistentvolumeclaims | pvc | List PVCs |
statefulsets | sts | List statefulsets |
daemonsets | ds | List daemonsets |
jobs | - | List jobs |
cronjobs | cj | List cronjobs |
Common Flags
| Flag | Purpose |
|---|---|
-n namespace | Filter by namespace |
-A | All namespaces |
-o wide | Show more details (IPs, nodes) |
-o yaml | Output as YAML |
-o json | Output as JSON |
-w | Watch for changes |
-l app=nginx | Label selector |
Examples
Get pods with more details:
$ 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-1Get all resources in a namespace:
$ kubectl get all -n productionGet multiple resources:
$ kubectl get pods,svc,deployments -n productionGet nodes with labels:
$ kubectl get nodes --show-labelsWatch pods in real-time:
$ kubectl get pods -wGet pods with a label selector:
$ kubectl get pods -l app=nginxGet pods in YAML format:
$ kubectl get pod nginx -o yamlGet pods in JSON format (for scripting):
$ kubectl get pod nginx -o json | jq '.status.phase'kubectl describe — Show Resource Details
Shows detailed information about a resource.
Basic Usage
$ 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 nginxCommon Uses
Describe a pod:
$ kubectl describe pod my-podDescribe a service:
$ kubectl describe svc my-serviceDescribe a deployment:
$ kubectl describe deploy my-deploymentDescribe a node:
$ kubectl describe node node-1Describe with namespace:
$ kubectl describe pod my-pod -n productionkubectl api-resources — List API Resources
Lists all available API resources in the cluster.
Basic Usage
$ 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 ServiceCommon Flags
| Flag | Purpose |
|---|---|
--namespaced=true | Show only namespaced resources |
--namespaced=false | Show only cluster-scoped resources |
--verbs=list | Show resources that support list |
Examples
Show namespaced resources only:
$ kubectl api-resources --namespaced=trueShow cluster-scoped resources only:
$ kubectl api-resources --namespaced=falseQuick Reference — Most Used Commands
| Task | Command |
|---|---|
| Show cluster info | kubectl cluster-info |
| Dump cluster info | kubectl cluster-info dump |
| List pods | kubectl get pods |
| List pods in namespace | kubectl get pods -n production |
| List pods in all namespaces | kubectl get pods -A |
| List pods with details | kubectl get pods -o wide |
| Watch pods | kubectl get pods -w |
| Describe pod | kubectl describe pod my-pod |
| Describe deployment | kubectl describe deploy my-deployment |
| List all resources | kubectl get all |
| List nodes | kubectl get nodes |
| List namespaces | kubectl get namespaces |
| List API resources | kubectl api-resources |
Pro Tips
-
Use
-o widefor important details: IP addresses, node names, etc. -
Use
-wto watch resources change in real-time. -
describeis great for troubleshooting — shows events and status. -
Use
-Awhen you don't know which namespace:kubectl get pods -A -
Use
api-resourcesto discover new resources: helpful with CRDs. -
Check cluster health with
cluster-info. -
Use
get allto see everything in a namespace. -
Combine
getwithgrepfor filtering:kubectl get pods | grep Running