[VC]: Update Controller Runtime to 2.9 #738
[VC]: Update Controller Runtime to 2.9 #738
Conversation
a71a90d
to
bf8a9b9
Compare
/assign @Fei-Guo |
One caveat that people might run into using the newer version of I’d like to look into better ways of handling this in later versions of the |
@charleszheng44 this should be what we need so that we can use some of the better customizations from |
@christopherhein: GitHub didn't allow me to assign the following users: charleszheng44. Note that only kubernetes-sigs members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I was trying
Also, I didn't expect the size of the crd file changes from 16k to 1.5MB. Is there a way to shrink it? We seldom look at crd yaml for all the field explanations. |
Ah, let me change up the About the size, I can see if I can remove the field definitions. It’s mostly preparing for the OpenAPI v3 scheme client side validation and for allowing newer clusters to use Chatting with other people in the past they have reimplemented the go types that they needed instead of importing full types like we have in https://github.com/kubernetes-sigs/multi-tenancy/blob/master/incubator/virtualcluster/pkg/apis/tenancy/v1alpha1/clusterversion_types.go#L43-L46 It might make sense to change the external type here to |
bf8a9b9
to
66578aa
Compare
66578aa
to
58e641d
Compare
Oops, I also noticed I used 0.3.0 which is for the bleeding edge version of kubebuilder, the one that is currently stable and shipping with the latest kubebuilder is 2.5, I’m changed to that one and modified the |
Also WRT to the descriptions I’ve opened an issue with controller-tools and am researching the feasibility and interest so we can trim down the CRDs - kubernetes-sigs/controller-tools#441 |
I try to create the crd using the new crd yaml and hit the following,
my minikube version
|
I probably need to turn on the XEmbedded flag again, it appeared like I didn’t need but I must have been wrong. |
Also you might want to update your |
Correction, your latest issues it’s actually because of the 1.18 version incompatibility with controller-tools - kubernetes-sigs/controller-tools#440 |
This is problematic. It is even hard to workaround in 1.18. Adding default manually does not resolve the problem.
|
Given it seems like We should explore a different way for a those to be referenced. For example:
We could also leave this for now and discuss what a wdyt? |
/hold |
I think we should revisit the VirtualclusterStatus struct. We already have ClusterVersionName in the spec and I don't think it should be mutable. Our controller currently does not support changing the clusterversion. It seems that vc crd size problem is resolvable. |
could you should me how to generate these two file |
@zhuangqh with the |
The clusterversionhistory field has been removed from VirtualClusterStatus with #741 . The VC crd size is reduced to 4.7KB with controller-gen 2.5. |
Wow, that’s fantastic. Let me update this and maybe we can push it through? |
I still have concern about clusterversion crd size though. A 1.6MB yaml basically makes the crd not readable at all. The current crd yaml looks much more straightforward. |
58e641d
to
d254ede
Compare
d254ede
to
56f43c2
Compare
/unhold |
Signed-off-by: Chris Hein <me@chrishein.com>
Signed-off-by: Chris Hein <me@chrishein.com>
Signed-off-by: Chris Hein <me@chrishein.com>
56f43c2
to
dbb8cf0
Compare
@Fei-Guo I was able to remove all the descriptions on the specs reducing the size to 500kb for the entire spec for This still has the issue with 1.18 specs, that is being tracked across kubernetes-sigs/controller-tools#440 given that all controller-runtime 2.x projects are broken with this do you want to continue to wait on this? |
I am ok with current controller runtime 2.x and I tend to agree that we can remove statefulset object is clusterversion to further reduce the crd size. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: christopherhein, Fei-Guo The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This fixes #714 and makes sure that new generated files are always created the same. Now when you run
make generate
instead of usinggo generate
to generate the files this will usecontroller-gen
to create the deepcopy funcs and when you callmake manifests
it will create the files inconfig/crds/
.Signed-off-by: Chris Hein me@chrishein.com