Kubernetes API Resources, Groups, Versions & kubectl explain
Discover API groups/versions and use kubectl explain to read resource schemas.
In plain words
API discovery is a catalog and kubectl explain is the schema reader; the group/version pair selects the right edition of each entry. The simple Kubernetes rule is: Kubernetes identifies resources by group, version, and kind, while discovery and kubectl explain expose the schemas served by the selected API server.
Think of it like…
API discovery is a catalog and kubectl explain is the schema reader; the group/version pair selects the right edition of each entry.
Where you’ve seen it
A cluster operator validates a small change and runs kubectl api-resources; kubectl explain deployment.spec.strategy --recursive. Expected evidence: Kubernetes identifies resources by group, version, and kind, while discovery and kubectl explain expose the schemas served by the selected API server. If the run instead shows this symptom, stop and restore the last known state: Using a removed beta API or copying a field from a different served version produces discovery or strict-decoding failures during an upgrade.
Words you’ll hear
- API Groups
- For this lesson, API Groups is the controlling idea: Kubernetes identifies resources by group, version, and kind, while discovery and kubectl explain expose the schemas served by the selected API server.
- Versions
- Versions is the checkpoint; run
kubectl api-resources; kubectl explain deployment.spec.strategy --recursiveand inspect the owner chain. Using a removed beta API or copying a field from a different served version produces discovery or strict-decoding failures during an upgrade. - kubectl explain
- kubectl explain is the outcome to preserve; the cost is explicit: Version conversion preserves compatibility, but relying on undocumented server behavior delays migration and can break a client after the old API is removed.
- Verification evidence
- The evidence command is
kubectl api-resources; kubectl explain deployment.spec.strategy --recursive. It connects the declaration to this behavior: Discover API groups/versions and use kubectl explain to read resource schemas.
Visual diagram
Theory & deep dive
How API Groups reaches the intended state
Discover API groups/versions and use kubectl explain to read resource schemas. Kubernetes identifies resources by group, version, and kind, while discovery and kubectl explain expose the schemas served by the selected API server.
The concrete checkpoint is kubectl api-resources; kubectl explain deployment.spec.strategy --recursive; compare the API Groups owner, Versions state, and kubectl explain outcome instead of treating YAML acceptance as proof.
Run kubectl api-resources; kubectl explain deployment.spec.strategy --recursive after the change and correlate the result with Events and the owning object. Kubernetes identifies resources by group, version, and kind, while discovery and kubectl explain expose the schemas served by the selected API server.
Versions: failure boundary and production cost
Using a removed beta API or copying a field from a different served version produces discovery or strict-decoding failures during an upgrade. The prerequisite contract is concrete: Kubernetes identifies resources by group, version, and kind, while discovery and kubectl explain expose the schemas served by the selected API server.
Version conversion preserves compatibility, but relying on undocumented server behavior delays migration and can break a client after the old API is removed. A safe design limits blast radius, records the last good configuration, and uses kubectl api-resources; kubectl explain deployment.spec.strategy --recursive as a deterministic rollback checkpoint.
Capture the current state with kubectl api-resources; kubectl explain deployment.spec.strategy --recursive, then correct the controlling manifest rather than patching a child object; the relevant divergence signal is specific: Using a removed beta API or copying a field from a different served version produces discovery or strict-decoding failures during an upgrade.
How it works, step by step
Step 1 of 41. Model the cluster contract
Start from a minimal API, context, or node condition and make this contract explicit: Kubernetes identifies resources by group, version, and kind, while discovery and kubectl explain expose the schemas served by the selected API server.
- Goal
- Discover API groups/versions and use kubectl explain to read resource schemas.
- Owner
- API Groups
When to use it & trade-offs
What it is
Discover API groups/versions and use kubectl explain to read resource schemas. Kubernetes identifies resources by group, version, and kind, while discovery and kubectl explain expose the schemas served by the selected API server.
Why it matters: Using a removed beta API or copying a field from a different served version produces discovery or strict-decoding failures during an upgrade. The invariant at risk is specific: Kubernetes identifies resources by group, version, and kind, while discovery and kubectl explain expose the schemas served by the selected API server. The quickest fact check before changing the design is kubectl api-resources; kubectl explain deployment.spec.strategy --recursive.
When to reach for it
- Use API Groups to enforce this invariant: Kubernetes identifies resources by group, version, and kind, while discovery and kubectl explain expose the schemas served by the selected API server.
- Use Versions evidence from
kubectl api-resources; kubectl explain deployment.spec.strategy --recursivein reviews and incident timelines. Discover API groups/versions and use kubectl explain to read resource schemas. - Choose the platform-level abstraction route only when this cost is justified by governance or scale: Version conversion preserves compatibility, but relying on undocumented server behavior delays migration and can break a client after the old API is removed.
When to avoid or be careful
- Avoid assuming API Groups is complete after YAML submission; the required behavior is concrete: Kubernetes identifies resources by group, version, and kind, while discovery and kubectl explain expose the schemas served by the selected API server.
- Avoid treating the next symptom as random; check the owner and state with
kubectl api-resources; kubectl explain deployment.spec.strategy --recursivefirst: Using a removed beta API or copying a field from a different served version produces discovery or strict-decoding failures during an upgrade. - Avoid adopting a heavier platform wrapper before measuring its cost: Version conversion preserves compatibility, but relying on undocumented server behavior delays migration and can break a client after the old API is removed.
Native, manual, and managed paths for API Groups
kubectl api-resources; kubectl explain deployment.spec.strategy --recursive.Strengths: Kubernetes identifies resources by group, version, and kind, while discovery and kubectl explain expose the schemas served by the selected API server.
Watch out: Version conversion preserves compatibility, but relying on undocumented server behavior delays migration and can break a client after the old API is removed. Recovery must also recognize this signal: Using a removed beta API or copying a field from a different served version produces discovery or strict-decoding failures during an upgrade.
kubectl api-resources; kubectl explain deployment.spec.strategy --recursive; the expected invariant is: Kubernetes identifies resources by group, version, and kind, while discovery and kubectl explain expose the schemas served by the selected API server.Strengths: kubectl api-resources; kubectl explain deployment.spec.strategy --recursive gives immediate feedback without first building a platform layer.
Watch out: A manual change can hide drift, and unlike API Groups, it does not make this symptom self-documenting: Using a removed beta API or copying a field from a different served version produces discovery or strict-decoding failures during an upgrade.
kubectl api-resources; kubectl explain deployment.spec.strategy --recursive.Strengths: Platform controls can wrap this exact behavior in policy or dashboards: Kubernetes identifies resources by group, version, and kind, while discovery and kubectl explain expose the schemas served by the selected API server.
Watch out: The added platform ownership buys value at this cost: Version conversion preserves compatibility, but relying on undocumented server behavior delays migration and can break a client after the old API is removed.
Interview signals & numbers to know
When this topic comes up
- Interview anchor: Kubernetes identifies resources by group, version, and kind, while discovery and kubectl explain expose the schemas served by the selected API server.
- Trace API Groups to kubectl explain through Versions; the invariant is: Kubernetes identifies resources by group, version, and kind, while discovery and kubectl explain expose the schemas served by the selected API server.
- Recognize the symptom: Using a removed beta API or copying a field from a different served version produces discovery or strict-decoding failures during an upgrade.
- Justify the cost: Version conversion preserves compatibility, but relying on undocumented server behavior delays migration and can break a client after the old API is removed.
- Verify with kubectl api-resources; kubectl explain deployment.spec.strategy --recursive instead of only inspecting YAML.
Benchmarks & rules of thumb
- 3
- identity parts to name an API type: group, version, and kind
- 2
- fresh checks to use after upgrades: api-resources and explain
- 0
- unknown fields should survive a strict manifest review
Common mistakes & follow-ups
Common interview mistakes
- Debugging only the child object misses the API Groups owner contract: Kubernetes identifies resources by group, version, and kind, while discovery and kubectl explain expose the schemas served by the selected API server.
- Ignoring this telltale condition leads to unrelated changes: Using a removed beta API or copying a field from a different served version produces discovery or strict-decoding failures during an upgrade.
- Repeating
kubectl api-resources; kubectl explain deployment.spec.strategy --recursivewithout an owner for remediation wastes retry cost. Version conversion preserves compatibility, but relying on undocumented server behavior delays migration and can break a client after the old API is removed.
Likely interviewer follow-ups
- How would API output and runtime evidence prove this behavior: Kubernetes identifies resources by group, version, and kind, while discovery and kubectl explain expose the schemas served by the selected API server?
- Which owner object, logs, and Events would you inspect for this symptom-Using a removed beta API or copying a field from a different served version produces discovery or strict-decoding failures during an upgrade-?
- At what threshold would this cost become unacceptable: Version conversion preserves compatibility, but relying on undocumented server behavior delays migration and can break a client after the old API is removed?
kubectl api-resources; kubectl explain deployment.spec.strategy --recursive, name the failure, then justify the cost. Invariant: Kubernetes identifies resources by group, version, and kind, while discovery and kubectl explain expose the schemas served by the selected API server. Failure: Using a removed beta API or copying a field from a different served version produces discovery or strict-decoding failures during an upgrade. Cost: Version conversion preserves compatibility, but relying on undocumented server behavior delays migration and can break a client after the old API is removed.Knowledge check
Put it into practice
Practice related interview Q&A
Apply Kubernetes API Resources, Groups, Versions & kubectl explain with generative AI interview Q&A and hands-on practice.