spec and status
The two halves of most Kubernetes objects: spec is what you ask for, and status is what the cluster reports is actually true.
In more detail
You write the spec; controllers and the kubelet write the status. Comparing the two is the heart of troubleshooting, because a gap between them points at the component that has not finished its job. kubectl describe shows both, followed by recent events.
Example
kubectl get pod web -o jsonpath='{.status.phase}'Related terms
- desired state — A description of how a machine should look when the work is finished, rather than a list of steps to get there.
- status condition — A named true-or-false fact that a controller records in an object's status, such as Ready, Available or Accepted, with a reason and a time.
- kubectl describe — The kubectl command that prints a readable summary of an object: its settings, current status and recent events.
- Kubernetes object — A record stored in the cluster that describes one thing you want, such as a Pod, a Service or a Namespace.
Taught in
- ConfigMaps And Secrets — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Custom Resources And Operators — Certified Kubernetes Application Developer (CKAD) Exam Prep
- From Docker To Desired State — Kubernetes: Production-Grade Container Orchestration
- Worker Nodes: kubelet, Runtime, CNI And kube-proxy — Kubernetes: Production-Grade Container Orchestration
- Namespaces, Labels And Declarative Manifests — Kubernetes: Production-Grade Container Orchestration
- Troubleshooting: describe, Events And A First Smoke Test — Kubernetes: Production-Grade Container Orchestration
- Pods, Init Containers And Sidecars — Kubernetes: Production-Grade Container Orchestration
- Deployments, ReplicaSets, Rollouts And Rollback — Kubernetes: Production-Grade Container Orchestration
- DaemonSets And Node Services — Kubernetes: Production-Grade Container Orchestration
- Jobs And CronJobs — Kubernetes: Production-Grade Container Orchestration