Hands-on Lab·Certified Kubernetes Administrator
First kubectl Session: Inspecting a Cluster
Six commands that tell you what cluster you are pointed at, what it can be asked for, and what every field in a manifest means. Learn these and you stop needing the documentation open for field names.
Foundations Guide 2 of 103 Beginner
- Kubernetes1.36.4
- Cluster4 nodes
- Runtimecontainerd 2.2.6
- CNICalico v3.32.1
- TimeAbout 20 min
Counts like 27 API groups and 26 running Pods are this cluster's, not universal. The commands that produce them are.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| CKA1001 | 192.168.0.175 | Ubuntu 26.04 LTS | Control Plane Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE01 | 192.168.0.176 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE02 | 192.168.0.177 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE03 | 192.168.0.178 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
This guide includes
Use this the first time you are handed a cluster and have to work out what it is. This matters because the alternative is guessing at resource names and field paths, and six commands replace all of that guessing.
- confirming which cluster you are pointed at before running anything destructive
- reading client and server versions separately, because they are two different things
- listing what this cluster can actually be asked for with
kubectl api-resources - using
kubectl explain --recursiveas the field reference you already have, offline - shaping output with
-o wideandcustom-columnsinstead of reading tables by eye
Before you start
- A cluster you can reach and a working
kubectl. Any of the installation guides gets you one. - Nothing else. This guide reads; it does not create anything.
-
Which cluster am I actually talking to?
-
Client and server version, separately
-
What can this cluster even be asked for?
-
The API groups, and why there are so many
-
kubectl explain, the field reference you already have
-
Shape the output instead of reading it