Keep old and new clients working during a migration
A CRD can serve multiple API versions while storing custom resources in one version. Add the new version, provide conversion when fields change, migrate clients and stored objects, then remove the old version after verifying it is unused. This gives developer teams time to update manifests and automation.
Understand served and storage versions
Each CRD version has a served setting and one version is designated for storage. The API server converts objects between the storage representation and the version requested by a client. When the schema shape changes, a conversion webhook can translate between representations; when only the API version label changes and the schemas match, the None strategy can be enough.
Treat a version name such as v1beta1 or v1 as a compatibility promise. Before stabilizing the API, review field names, defaults, status conditions, and what happens when developers omit a field. Removing or changing a field can affect manifests, GitOps controllers, scripts, and clients at once.
Introduce a version in stages
A controlled migration keeps both versions available during the transition. First publish the new schema and conversion support. Then move the storage version and let teams update consumers in increments. Kubernetes supports serving old and new versions at the same time, which makes a gradual rollout possible.
Before retiring an old API, inspect API server logs or other usage evidence for remaining clients. Migrate stored objects to the new storage version, verify that the old version no longer appears in status.storedVersions, and only then remove its definition and conversion path. An unused manifest in a repository can still become a deployment failure months later, so include examples and generated clients in the search.
Keep conversion predictable
A conversion function should preserve the meaning of the request. If the old API has one field that becomes two in the new version, define how old values map and what the reverse conversion does when information cannot be represented. Avoid silently discarding user intent.
Conversion webhooks receive batches of objects and should convert each independently while preserving their order. They are on the API server request path, so availability and TLS configuration matter. Exercise conversions in both directions with representative objects, including defaults, empty values, and deprecated fields.
Deprecate with evidence and a migration path
Mark the old served version deprecated and provide a clear warning that names the replacement and migration guidance. Give consumers a period to move and track usage through actual API server evidence. A calendar date alone does not show that teams are ready.
Publish before-and-after manifests, explain field mapping, and update sample code and automation. Keep a rollback option while the old version is still served. When the API server reports no old-version use and stored objects have migrated, removal becomes a verifiable operation rather than a guess.
Review a CRD version change
Use this sequence during a platform API change review. The exact rollout order depends on how the CRD and controller are deployed, so validate it in a representative cluster before production.
- Document which fields or behavior changed and why consumers need a new version.
- Add the new version with its schema and conversion strategy while keeping the old version served.
- Test round-trip conversion for representative objects and confirm user intent survives.
- Move storage to the new version and migrate existing objects using the documented Kubernetes workflow.
- Find remaining old-version clients through API server logs or other usage data.
- Deprecate, then remove the old version only after clients and stored objects have migrated.
References & further reading
Need help with your Go backend?
I work with engineering teams on focused Go and Kubernetes platform engagements, with limited consulting availability.
Explore Go consulting services