-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
kubebuilder make install fails #3460
Comments
@rbroggi: The label(s) 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. |
HI @rbroggi, If you look at the code generate for the sample of the tutorial the target to generate the manifest has a customization to avoid this scenario. I think we could add a note in the tutorial explaining it. See:
Would you like to contribute with this one? |
This is missing from kubebuilder/docs/book/src/cronjob-tutorial/testdata/project/Makefile Lines 47 to 49 in 66f3fbc
|
The code above is from the sample of the cronjob itlsef. |
So would you see it as step instructing the reader of kubebuilder book to go and edit the |
I can try and do that... |
Maybe also worth adding it to FAQ? |
To summarise:
|
I met this problem too, and I tried to add |
See the comment with the explanation:
K8s has a limitation regards the size of CRDs. Please see: #1140 (comment) Therefore, what we can do here is:
When I say create a note? See the docs and look for
You need to add the option and then run make manifests to generate the CRD with. |
Hey @camilamacedo86 , thank you very much for your detailed explanation! I will try to follow up with that. Something I would like to disambiguate is:
❯ rg -l 'crd:maxDescLen=0'
docs/book/src/multiversion-tutorial/testdata/project/Makefile ❯ rg -l "^manifests:"
pkg/plugins/golang/v3/commons.go
pkg/plugins/golang/declarative/v1/scaffolds/internal/templates/channel.go
pkg/plugins/golang/v3/scaffolds/internal/templates/makefile.go
pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
pkg/plugins/golang/v2/scaffolds/internal/templates/makefile.go
docs/book/src/reference/generating-crd.md
docs/book/src/component-config-tutorial/testdata/project/Makefile
docs/book/src/reference/makefile-helpers.md
docs/book/src/cronjob-tutorial/testdata/project/Makefile
testdata/project-v4-with-deploy-image/Makefile
testdata/project-v4/Makefile
testdata/project-v2/Makefile
testdata/project-v3/Makefile
testdata/project-v4-multigroup/Makefile
testdata/project-v4-declarative-v1/Makefile
testdata/project-v4-declarative-v1/channels/stable
testdata/project-v4-with-grafana/Makefile
docs/book/src/multiversion-tutorial/testdata/project/Makefile Should we also put the options in all the Makefiles on top of the observation that you suggested above? Thx 😄 |
Hi @rbroggi, I think we should only add a note info to explain when/why and how workaround the scenario. We should not add the option crd:maxDescLen=0 in the default scaffold because it is an workaround. See that not all scenarios will face that. The error only occurs if you create a CRD where it has more than the limit size defined in k8s api which usually is possible to be sorted out if you remove the descriptions from it to reduce the size. So, as you can see it is not something that must or should be done by default. I would either recommend you think a lot about the design of your APIs/CRDs and personally try to follow the DDD principle so that you have a better maintainability, re-usage of your solution and also you much avoid this issue as well. |
Hey @camilamacedo86 is the solution you suggested above still valid? |
I would like to take this up |
Hello @rbroggi As I will start working on this. Would you like to add anything? The plan is to add note as suggested by @camilamacedo86 in relatable doc page. |
Hello @rbroggi @camilamacedo86 which would be the place to add this note. |
I'm guessing that what @camilamacedo86 had in mind was to have it close to the sections containing the shell commands where the simple |
What broke? What's expected?
Following the kubebuilder book, the make install step fails with the error message:
As described in this post the issue derives from the auto-generated annotation when running
kubectl apply
.Running the same command with
kubectl create
orkubectl replace
works.I was wondering how to correct this issue. Possible approaches:
make install
;install
target slightly more intelligent and dynamically chooseapply
,create
orreplace
depending on whether the CRDs exist and on the possible error;kubectl apply
- here a further discussion needs to be triggered on whether we even want to solve this issue and what impacts that could generate (not sure it would be backwards compatible)kubectl apply
make a more detailed error and suggest usage ofcreate
orreplace
commands instead.Reproducing this issue
Follow the kubebuilder book up to the
make install
in this book section.KubeBuilder (CLI) Version
Version: main.version{KubeBuilderVersion:"v3.10.0-110-gd9c14df9", KubernetesVendor:"unknown", GitCommit:"d9c14df9d84fafd08c9ec88441e9ce218ad6effa", BuildDate:"2023-06-16T09:47:40Z", GoOs:"darwin", GoArch:"arm64"}
PROJECT version
version: "3"
Plugin versions
- go.kubebuilder.io/v4
Other versions
go version go1.20.4 darwin/arm64
sigs.k8s.io/controller-runtime v0.15.0
Extra Labels
/kind documentation
The text was updated successfully, but these errors were encountered: