Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple CRD APIVersions and migration #57316

Closed
tatsuhiro-t opened this issue Dec 18, 2017 · 11 comments
Closed

Multiple CRD APIVersions and migration #57316

tatsuhiro-t opened this issue Dec 18, 2017 · 11 comments
Assignees
Labels
area/custom-resources kind/feature Categorizes issue or PR as related to a new feature. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.

Comments

@tatsuhiro-t
Copy link
Contributor

Is this a BUG REPORT or FEATURE REQUEST?:

/kind feature

What happened:

I defined a CRD whose APIVersion is v1alpha1. Now things went well, I want to change APIVersion to v1. But CRD.Spec.Version is immutable, and I could not change it. CRD requires its name must match plural, and group, I could not add another CRD with the different version.
Backup custom objects, and delete current CRD, and create new CRD, then importing custom objects will work, but I want easier migration.

What you expected to happen:

CRD can have multiple versions.
A way to migrate between versions (just like we can get Deployment from both apps/v1beta1 and apps/v1beta2) is highly desirable.

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version):
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:
@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 18, 2017
@k8s-github-robot k8s-github-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Dec 18, 2017
@tatsuhiro-t
Copy link
Contributor Author

/sig api-machinery

@k8s-ci-robot k8s-ci-robot added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Dec 18, 2017
@k8s-github-robot k8s-github-robot removed the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Dec 18, 2017
@nikhita
Copy link
Member

nikhita commented Dec 18, 2017

/area custom-resources

/cc @sttts @deads2k @enisoc

@sttts
Copy link
Contributor

sttts commented Dec 18, 2017

We cannot support multiple versions of a CRD because there is no mechanism that can dynamically convert between them. There is a discussion going on in sig-apimachinery whether multiple versions are in scope or not, and if yes, how to add conversions for CRDs.

For the use-case here though the question is whether we can at least allow to change the (one and only) version of CRD without loosing any data. Right now this is not possible. Technically, this could certainly be done. The big question is whether we want to offer that.

Semantically, this would mean that all existing CRs are "suddenly" returned with the updated version string, but the old, unchanged schema. In other words, the consumers of the CR have to make sure that all CRs are migrated (trivial if the migration is a Noop).

/cc @nikhita @caesarxuchao @deads2k @enisoc

cofyc added a commit to cofyc/prometheus-operator that referenced this issue Dec 20, 2017
@yliaog
Copy link
Contributor

yliaog commented Dec 21, 2017

/cc @yliaog

@mbohlool
Copy link
Contributor

/sub

@nikhita
Copy link
Member

nikhita commented Jan 17, 2018

@nikhita
Copy link
Member

nikhita commented Jan 23, 2018

CRD versioning feature issue: kubernetes/enhancements#544.

@mbohlool mbohlool self-assigned this Jan 23, 2018
@nikhita
Copy link
Member

nikhita commented Feb 25, 2018

WIP is in #60113.

@nikhita
Copy link
Member

nikhita commented May 10, 2018

xref #63518 - CRD Versioning with no-op Conversion

@nikhita
Copy link
Member

nikhita commented Jun 4, 2018

Just for the record: no-conversion versioning has been implemented in #63830. It will be present in 1.11.

@liggitt
Copy link
Member

liggitt commented Jul 9, 2018

addressed by no-op conversion, released in 1.11

/close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/custom-resources kind/feature Categorizes issue or PR as related to a new feature. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.
Projects
None yet
Development

No branches or pull requests

8 participants