A spec is the part of a Kubernetes API object manifest where you declare the object’s desired state. Its fields depend on the object kind: a Pod spec can describe containers and storage volumes, while a Node spec can include the pod IP range assigned to that node. The status section records the current observed state instead. section 4.1.2 section 4.2.1
Use the spec as part of Kubernetes’ desired-state control loop:
- Declare or change the configuration in the object manifest’s spec section. section 4.1.2
- Let controllers watch the spec and reconcile the cluster’s actual state with it. section 4.3
- Read status to see what Kubernetes currently observes, and inspect events when reconciliation encounters problems. section 4.1.2 section 4.3
Inspecting a Node spec
Run `kubectl get node kind-control-plane -o yaml` to view a complete Node object. Its `spec` includes `podCIDR: 10.244.0.0/24` and `podCIDRs`, while `status` contains observed addresses, capacity, conditions, cached images, and operating-system details. Use `kubectl explain node.spec` to inspect the available fields and their descriptions; add `--api-version` when examining another API version. section 4.2.1 section 4.2.2
Figure 4.3 The main sections of a Kubernetes API object
Use the object-structure diagram to distinguish spec from type metadata, object metadata, and status. section 4.1.2
