Kubernetes API conventions
The Kubernetes API conventions from the Kubernetes project (SIG Architecture), read from contributors/devel/sig-architecture/api-conventions.md in the kubernetes/community repository.
Follow the workflow below step by step. Every rule here comes from a source in Sources. Quoted requirements are sentences taken from the pinned text, labelled with the section they come from. When a rule and the pinned source disagree, the source wins; when the source has a newer revision than the pin, follow the refresh steps.
Inputs (fill in, or ask before starting)
- Role: API author designing a built-in or custom resource, controller author writing status and conditions, or reviewer of a Kubernetes API change.
- Target version: Kubernetes API conventions (current). See
references/versions.md.
- Revision: the pinned revision in Sources, unless the user names another.
- Sources: when refreshing this skill, re-read every URL in Sources and check the publisher for a newer revision or version line.
Invariants
- API Conventions (introduction). "Group names must be lower case and be valid DNS subdomains."
- Metadata. "Every object kind MUST have the following metadata in a nested object field called "metadata":"
- Spec and Status. "The PUT and POST verbs on objects MUST ignore the
status values, to avoid accidentally overwriting the status in read-modify-write scenarios."
- Spec and Status. "A
/status subresource MUST be provided to enable system components to update statuses of resources they manage."
- Typical status properties. "Condition types should be named in PascalCase."
- Idempotency. "All compatible Kubernetes APIs MUST support "name idempotency" and respond with an HTTP status code 409 when a request is made to POST an object that has the same name as an existing object in the system."
- Optional vs. Required. "Fields must be either optional or required."
- Serialization Format. "APIs may return alternative representations of any resource in response to an Accept header or under alternative endpoints, but the default serialization for input and output of API responses MUST be JSON."
- Units. "Duration fields must be represented as integer fields with units being part of the field name (e.g.
leaseDurationSeconds)."
- Naming conventions. "Go field names must be PascalCase. JSON field names must be camelCase."
- Label, selector, and annotation conventions. "Key prefixes under the "kubernetes.io" and "k8s.io" domains are reserved for use by the kubernetes project and must not be used by third-parties."
Workflow
- Pick the version. Use the current line unless a named consumer needs a supported one. Do not author a legacy line. Emit a preview only when its posture is build and the user asked for that draft.
->
references/versions.md
✓ The target version is recorded, and it is not a legacy line.
- Apply the pinned requirements. Walk the quotes in
references/requirements.md and implement each one that applies to the role.
-> references/requirements.md
✓ Each applicable quote is either implemented or recorded as out of scope for the role, with the section it came from.
- Upgrade (only when asked). Follow the upgrade section from the source line to the target.
->
references/versions.md
✓ The result cites the target line and no longer depends on a requirement that only the old line stated.
Verify before done
Reference index
references/versions.md: every version line, which one to use, and how to upgrade. Load for steps 1 and 3.
references/requirements.md: quotes taken from the pinned specification, grouped by source. Load for step 2.
Related skills
Install related spec skills by name with npx skills add ScaleDockHQ/scaledock-skills --skill <name>: json, yaml, json-patch, openapi, google-aip.
Sources
Status uses the publishing body's own maturity term. Checked is the date the source was last read.
1---2name: kubernetes-api-conventions3description: >-4 Kubernetes API conventions: design Kubernetes resources with spec, status, metadata and conditions. Covers Kubernetes API conventions. Use when designing a Kubernetes API. Triggers: Kubernetes API conventions.5license: MIT6metadata:7 source: https://skillmd.com/skills/scaledockhq/kubernetes-api-conventions8 author: ScaleDockHQ9 version: "1.1.0"10 kind: standard11---1213# Kubernetes API conventions1415The Kubernetes API conventions from the Kubernetes project (SIG Architecture), read from `contributors/devel/sig-architecture/api-conventions.md` in the kubernetes/community repository.1617**Follow the workflow below step by step.** Every rule here comes from a source in [Sources](#sources). Quoted requirements are sentences taken from the pinned text, labelled with the section they come from. When a rule and the pinned source disagree, the source wins; when the source has a newer revision than the pin, follow the refresh steps.1819## Inputs (fill in, or ask before starting)2021- Role: API author designing a built-in or custom resource, controller author writing status and conditions, or reviewer of a Kubernetes API change.22- Target version: Kubernetes API conventions (current). See [`references/versions.md`](references/versions.md).23- Revision: the pinned revision in [Sources](#sources), unless the user names another.24- Sources: when refreshing this skill, re-read every URL in [Sources](#sources) and check the publisher for a newer revision or version line.2526## Invariants27281. **API Conventions (introduction).** "Group names must be lower case and be valid DNS subdomains."292. **Metadata.** "Every object kind MUST have the following metadata in a nested object field called "metadata":"303. **Spec and Status.** "The PUT and POST verbs on objects MUST ignore the `status` values, to avoid accidentally overwriting the `status` in read-modify-write scenarios."314. **Spec and Status.** "A `/status` subresource MUST be provided to enable system components to update statuses of resources they manage."325. **Typical status properties.** "Condition types should be named in PascalCase."336. **Idempotency.** "All compatible Kubernetes APIs MUST support "name idempotency" and respond with an HTTP status code 409 when a request is made to POST an object that has the same name as an existing object in the system."347. **Optional vs. Required.** "Fields must be either optional or required."358. **Serialization Format.** "APIs may return alternative representations of any resource in response to an Accept header or under alternative endpoints, but the default serialization for input and output of API responses MUST be JSON."369. **Units.** "Duration fields must be represented as integer fields with units being part of the field name (e.g. `leaseDurationSeconds`)."3710. **Naming conventions.** "Go field names must be PascalCase. JSON field names must be camelCase."3811. **Label, selector, and annotation conventions.** "Key prefixes under the "kubernetes.io" and "k8s.io" domains are reserved for use by the kubernetes project and must not be used by third-parties."3940## Workflow41421. **Pick the version.** Use the current line unless a named consumer needs a supported one. Do not author a legacy line. Emit a preview only when its posture is build and the user asked for that draft.43 -> [`references/versions.md`](references/versions.md)44 ✓ The target version is recorded, and it is not a legacy line.452. **Apply the pinned requirements.** Walk the quotes in [`references/requirements.md`](references/requirements.md) and implement each one that applies to the role.46 -> [`references/requirements.md`](references/requirements.md)47 ✓ Each applicable quote is either implemented or recorded as out of scope for the role, with the section it came from.483. **Upgrade** (only when asked). Follow the upgrade section from the source line to the target.49 -> [`references/versions.md`](references/versions.md)50 ✓ The result cites the target line and no longer depends on a requirement that only the old line stated.5152## Verify before done5354- [ ] The artifact cites the target line's revision from [Sources](#sources).55- [ ] Every applicable quoted requirement in [`references/requirements.md`](references/requirements.md) holds.56- [ ] The resource has `spec` and `status`, and writes to `status` go through the `/status` subresource (Spec and Status).57- [ ] Nothing from a preview line is emitted unless its posture is build and the user opted in.5859## Reference index6061- **`references/versions.md`**: every version line, which one to use, and how to upgrade. Load for steps 1 and 3.62- **`references/requirements.md`**: quotes taken from the pinned specification, grouped by source. Load for step 2.6364## Related skills6566Install related spec skills by name with `npx skills add ScaleDockHQ/scaledock-skills --skill <name>`: `json`, `yaml`, `json-patch`, `openapi`, `google-aip`.6768## Sources6970Status uses the publishing body's own maturity term. Checked is the date the source was last read.7172- [Kubernetes API conventions](https://raw.githubusercontent.com/kubernetes/community/3bc2da62f72a7a05b8838014be60566668edc3e3/contributors/devel/sig-architecture/api-conventions.md): SIG Architecture convention, main at commit 3bc2da6, 2026-10-06, checked 2026-10-06.