liveBook · Manning

Kubectl get

As explained in Acing the Certified Kubernetes Administrator Exam, Second Edition

kubectl get is a kubectl subcommand that retrieves and displays Kubernetes resources and their attributes.

Use kubectl get to retrieve and display Kubernetes resources and their attributes. It provides a quick view of observable cluster state while creating, scaling, or troubleshooting workloads. section 8.1.1 section 8.2

Common operational checks include:

  • Run kubectl get po to list pods in the current namespace and inspect readiness, status, restarts, and age. section 8.1.1
  • Run kubectl get deploy,po to view a Deployment together with its pods and compare availability with pod state. section 8.2
  • Run kubectl get po -A to inspect pods across all namespaces when the relevant namespace is uncertain. section 8.2
  • Use the result to choose a deeper diagnostic command, such as kubectl logs or kubectl describe po. section 8.1.1 section 8.2

Verify a scaled Deployment

After creating prod-app with one nginx replica, kubectl get deploy,po shows the Deployment and its running pod. After scaling to three replicas, kubectl get po exposes two Pending pods and one Running pod, directing troubleshooting toward the scheduler. section 8.2

root@kind-control-plane:/# kubectl get po
NAME                     READY   STATUS    RESTARTS      AGE
busybox                  2/2     Running   0             1m
mysql-5dcb7797f7-6spvc   1/1     Running   2 (22h ago)   45h

Representative pod-list output shows READY, STATUS, RESTARTS, and AGE columns for immediate cluster-state assessment. section 8.1.1

How Acing the Certified Kubernetes Administrator Exam, Second Edition covers it

How deep it goes
Demonstrates concise commands and representative output, then defers detailed causes to logs, describe, and manifest inspection.
Examples
Shows pod listings, combined Deployment-and-pod output, all-namespace output, and Pending pods after scaling.
What it assumes
Assumes familiarity with Kubernetes pods, Deployments, namespaces, and basic workload creation or scaling commands.
What you can do after
Diagnose/debug with it by identifying abnormal readiness, status, restarts, age, namespace placement, or replica availability.
How it connects
Connects resource listings with pods, Deployments, namespaces, container logs, scheduler failures, and desired replica counts.

Also explained in

Compare how 2 books explain kubectl get →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the Certified Kubernetes Administrator Exam, Second Edition. The section links point to the parts of the book it draws on.