First read-only inspection
Inspect before making changes
Use kubectl get for an inventory, describe for details about an individual object, and logs for application output. These operations can contact a server and require permission, even though they do not modify workload objects. The commands below are optional examples for the approved lab from the previous lesson. All displayed results are synthetic; no cluster is needed for the exercise.
Find available resources
A resource is a type of object exposed through the API. Before inspecting one, you can ask the approved server what it offers. The following commands list resource types and available API group versions. Results vary by installed APIs and access.
kubectl --kubeconfig=./bm-lab.conf --context=bm-lab --namespace=book-lab api-resourceskubectl --kubeconfig=./bm-lab.conf --context=bm-lab --namespace=book-lab api-versionsThe resource inventory indicates whether a type is namespaced. For example, Pods are namespaced, but Nodes are cluster-scoped. API discovery is not a test of application readiness.
Example: read a Pod inventory
Assume the lab owner has already supplied three fictional one-container Pods in book-lab. Use:
kubectl --kubeconfig=./bm-lab.conf --context=bm-lab --namespace=book-lab get podsSynthetic output:
NAME READY STATUS RESTARTS AGEcatalog 1/1 Running 0 4mcheckout 0/1 Running 2 4mreports 0/1 Pending 0 2mREADY shows ready containers compared with the total in these simple Pods. STATUS is a human-readable CLI display, not always the Pod phase. RESTARTS records container restarts; AGE is time since object creation, not how long the application has been healthy. catalog has a ready container, but that is not a complete end-to-end application test.
Example: investigate a Pending Pod
Ask for details of reports:
kubectl --kubeconfig=./bm-lab.conf --context=bm-lab --namespace=book-lab describe pod reportsSynthetic shortened detail:
Node: <none>Status: PendingConditions: Type Status PodScheduled False Ready FalseEvents: Warning FailedScheduling 0/1 nodes available: insufficient cpuThe recorded evidence suggests a placement problem in this fictional case. Pending alone does not establish that cause: a Pod can also be Pending after placement while containers are being prepared. Inspect conditions and events rather than immediately recreating the Pod. Event text and availability vary, and events may age out.
Example: investigate a Running but not-ready Pod
For checkout, the detail snapshot says Node: bm-worker, PodScheduled=True, Ready=False. A container process can be running while the application is not ready. Since there have been restarts, check bounded application output, and if available, the previous terminated container instance:
kubectl --kubeconfig=./bm-lab.conf --context=bm-lab --namespace=book-lab logs checkout -c app --tail=20kubectl --kubeconfig=./bm-lab.conf --context=bm-lab --namespace=book-lab logs checkout -c app --previous --tail=20The container name app belongs to this fictional fixture. A synthetic current log says waiting for configuration; a previous log says configuration missing. These are clues, not definitive root-cause proof. Previous logs may be unavailable, and logs can contain sensitive information. Do not copy real logs into an educational report.
Interpret errors without guessing
A forbidden response means the request was not authorized; it does not prove that the Pod is absent. A successful empty list means no objects were returned in the requested scope at that time. NotFound for a named Pod may mean the name or namespace is wrong or the object is gone. Confirm scope and access before interpreting missing results. Connection or certificate errors require lab setup review, not blind retries or insecure flags.
Practice: write a short incident note
Use the pod-inspection fixture. Record the intended namespace, each Pod name, its readiness, and one next read-only observation. Separate facts (reports is unassigned) from a hypothesis (requested CPU exceeds what the scheduler can place). Do not change resources yet. Next chapter teaches the YAML and JSON object descriptions that these commands inspect.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
First read-only inspection — knowledge check
Apply the concepts from this lesson to short offline scenarios.
Which Pod in the synthetic table is running but not ready?
Which detail most directly supports investigating placement for reports?
Which command requests the previous terminated app container logs?
A list request returns Forbidden. What can you conclude?
What does api-resources help discover?