Reconcile Multiple Major Versions of Custom Resource #3991
-
Hi, is there a way to reconcile two parallel major versions of a custom resource without running through a conversion hook in the same project? Why I am interested in that? The reason behind is simple. The major versions v1 and v2 are incompatible and have disjoint attributes which makes a conversion impossible. For compatible versions like v1beta1 to v1 I am using conversion hooks which works pretty fine. Is it possible to label both major versions as storage version? Thx! Regards |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Unfortunately, Kubernetes does not support labeling both versions as the storage version simultaneously. In Kubernetes API versioning, only one version of a resource can be designated as the storage version at any given time. This version is used to store all the data for that resource in etcd. A common approach is to use webhooks to convert one version to another. If this approach does not work, you might need to maintain separate CustomResourceDefinitions (CRDs) for each major version. This way, each version can operate independently without the need for conversion. That means you will need to have Kind A and Kind B either and a controller to manage each one of them. I hope that helps you out. I am closing this one but feel free to re-open if you need to. |
Beta Was this translation helpful? Give feedback.
Unfortunately, Kubernetes does not support labeling both versions as the storage version simultaneously. In Kubernetes API versioning, only one version of a resource can be designated as the storage version at any given time. This version is used to store all the data for that resource in etcd.
A common approach is to use webhooks to convert one version to another. If this approach does not work, you might need to maintain separate CustomResourceDefinitions (CRDs) for each major version. This way, each version can operate independently without the need for conversion. That means you will need to have Kind A and Kind B either and a controller to manage each one of them.
I hope that helps y…