starrocks-kubernetes-operator icon indicating copy to clipboard operation
starrocks-kubernetes-operator copied to clipboard

[CRD] versioning support in StarrocksCluster

Open mingmxu opened this issue 1 year ago • 2 comments

Describe the current behavior

Currently, CRD: StarrocksCluster has a fixed version apiVersion: starrocks.com/v1, without proper versioning and capability guarantee, the risk to upgrade CRD is unknown.

Describe the enhancement

Support versioning in CRD: StarrocksCluster, and add capability verification during CRD upgrade.

Additional context

Add any other context or screenshots about the enhancement here.

cc @dengliu @yandongxiao

mingmxu avatar Feb 07 '24 20:02 mingmxu

‌‌‌If we are just marking the version information of CRD, can we add the corresponding version information to the annotation or label of CRD?

yandongxiao avatar Feb 21 '24 08:02 yandongxiao

It's good to stick using one version in CRD, if we're able to keep backward/forward compatible crossing the released CRDs:

  • the old CRs can be parsed by the new operator, this eliminates the migration effort when upgrading operator/crd;
  • the new CRs can be parsed by the old operator, this ensures it's safe to rollback operator upgrade;

Technically we can use webhook to rewrite CRs when compatibility is not guaranteed. I don't suggest to move that far until necessary, adding logic in operator to handle unset behaviors is much simpler.


Some more information in https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definition-versioning/

mingmxu avatar Feb 21 '24 18:02 mingmxu