kuberay icon indicating copy to clipboard operation
kuberay copied to clipboard

[Feature] Support CRD versioning

Open tgaddair opened this issue 2 years ago • 2 comments

Search before asking

  • [X] I had searched in the issues and found no similar feature requirement.

Description

The current kuberay CRD has changed a few times in the past year. Some of these changes have invalidated existing RayCluster configs, resulting in added migration complexity. In particular, if you have existing RayClusters that were created with the old CRD, it's not clear how to correctly migrate them to the new CRD without affecting users.

Kubernetes recommends two different approaches to CRD versioning:

  • Multiple versions at once
  • Webhook conversion

It would be great to understand which approach makes the most sense of kuberay and add versioning to the CRD going forward.

Use case

Supporting upgrades to new Ray Operator and CRD versions without breaking existing RayCluster configs.

Related issues

No response

Are you willing to submit a PR?

  • [X] Yes I am willing to submit a PR!

tgaddair avatar Mar 07 '22 22:03 tgaddair

I agree with that changes result in added migration complexity.

At the beginning, there are three CRDs in this repo. We have discussed in the last year and merge them into one CRD. I think we will work on this CRD , and the ray-operator controller will be compatible with all versions of the CRD. So Multiple versions at once looks good to me.

chenk008 avatar Mar 08 '22 08:03 chenk008

em. as @chenk008 said, there're historical reasons for the breaking changes. Current APIs is a result of redesign which does introduce the breaking changes.. version management will be improved after the unification.

Based on previous experience, we try not to introduce webhook for the conversion. Explicitly specifying the version sound better to me and we do have good practice in other projects.

  1. Any API changes should bump crd version. v1alpha1 -> v1alpha2 -> v1beta1 -> v1 -> v2alpha2 etc
  2. Suggest user to use pinned version. kuberay v0.2.0 etc.
  3. Release testing will cover upgrade tests and migration guidance should be provided

Jeffwan avatar Mar 08 '22 23:03 Jeffwan

Close this one in favor of #1209.

kevin85421 avatar Aug 18 '23 23:08 kevin85421