-
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
📖 Add Make install workaround #3543
📖 Add Make install workaround #3543
Conversation
docs/book/src/faq.md
Outdated
# However, it has a size limit and if the CRD is too big with so many long descriptions as this one it will cause the failure. | ||
$(CONTROLLER_GEN) rbac:roleName=manager-role crd:maxDescLen=0 webhook paths="./..." output:crd:artifacts:config=config/crd/bases | ||
|
||
Instead of Kubectl create command use Kubectl apply and it will work because kubectl create will send the request at once and it will fail while kubect apply send the request in small chunks so the desc len will be divided. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not kubectl that generate the manifests.
By using the maxDescLen=0 controller gen (see: https://book.kubebuilder.io/reference/controller-gen.html) will generate the CRD without description which will consequently reduce its size which might sort out the issue
Could you please change this line and also ensure that we link the doc above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understood the maxdesclen=0 in wrong way. Now I got it. So I changed what maxdesclen do. Also It is not kubectl that generate the manifests. I am unable to understand the context of this line. Can you please explain
Instead of Kubectl create command use Kubectl apply and it will work because kubectl create will send the request at once and it will fail while kubect apply send the request in small chunks so the desc len will be divided. | ||
|
||
Add maxDescLen=0 and it will ensure that the crd description size is utmost and hence it will go through it. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that in my comment, I added one more workaround option to ensure that the Single Responsibility principle is not violated. Can you please check that?
Also, we need to mention the ideal solution here, which would be to work with server-side, but it is not yet supported. In this case, would be either helpful ensure that we link the PR for controller-gen (please see my comment with the suggestions which has the PR as the issue)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added the link of controller-tools pr. But I am unsure about Single Responsibility principle In this comment You have talked about DDD principle. and in whole pr I didnt find anything about Single Responsibility principle. Can you please explain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work 🥇
Thank you for your contribution
It seems close to get shape enough to get merged.
Please, see the comments and also ensure that we have the commits squashed so that we can move forward.
1f6076a
to
e87bb9a
Compare
e87bb9a
to
719ef09
Compare
719ef09
to
378300f
Compare
I have rebase the pr succesfully. Thank you @camilamacedo86 for helping me. It's great to learn from you. Sorry for the mistakes I have made. Also let me know if any further changes required. |
I think the doc preview have some glitch. because it doesnt show the links in blue colour hyperlink. It shows it in markdown manner. Is there any issue or am I missing something? |
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Sajiyah-Salat,
Thank you for your contribution. 🥇
I re-review this one:
- See some small suggestions: https://github.com/kubernetes-sigs/kubebuilder/pull/3543/files
- When you to do docs changes you need verify how it will be after merge, See that my looking the markdown in the view mode you can check that it has a bug because the code block is not closed : https://github.com/kubernetes-sigs/kubebuilder/blob/7eadfe35a31071c95be718acc2150644c811132a/docs/book/src/faq.md
- Also, you can check here the final result of your changes: https://deploy-preview-3543--kubebuilder.netlify.app/faq
53a5642
to
650ae5f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont we need to remove this @camilamacedo86
docs/book/src/faq.md
Outdated
@@ -92,9 +92,39 @@ securityContext: | |||
``` | |||
However, note that this problem is fixed and will not occur if you deploy the project in high versions (maybe >= 1.22). | |||
|
|||
## The error `Too long: must have at most 262144 bytes` is faced when I run `make install` to apply the CRD manifests. How to solve it? Why this error is faced? | |||
|
|||
When attempting to run `make install` to apply the CRD manifests, the error Too long: must have at most 262144 bytes may be encountered. This error arises due to a size limit enforced by the Kubernetes API. Note that the `make install` target will apply the CRD manifest under `config/crd` using `kubectl apply -f -`. Therefore, when the apply command is used, the API annotates the object with the `last-applied-configuration` which contains the entire previous configuration. If this configuration is too large, it will exceed the allowed byte size. ([More info][k8s-obj-creation]) and this error will be faced. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When attempting to run `make install` to apply the CRD manifests, the error Too long: must have at most 262144 bytes may be encountered. This error arises due to a size limit enforced by the Kubernetes API. Note that the `make install` target will apply the CRD manifest under `config/crd` using `kubectl apply -f -`. Therefore, when the apply command is used, the API annotates the object with the `last-applied-configuration` which contains the entire previous configuration. If this configuration is too large, it will exceed the allowed byte size. ([More info][k8s-obj-creation]) and this error will be faced. | |
When attempting to run `make install` to apply the CRD manifests, the error Too long: must have at most 262144 bytes may be encountered. This error arises due to a size limit enforced by the Kubernetes API. Note that the `make install` target will apply the CRD manifest under `config/crd` using `kubectl apply -f`. Therefore, when the apply command is used, the API annotates the object with the `last-applied-configuration` which contains the entire previous configuration. If this configuration is too large, it will exceed the allowed byte size. ([More info][k8s-obj-creation]) and this error will be faced. |
0d9aad3
to
ad5dbf2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approved cancel |
a49d34d
to
b728f77
Compare
Hello @camilamacedo86 is there anything else here remaining. if not can we merge this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
It seems good to get merged.
All suggestions and recommendations made by @varshaprasad96 and I are addressed
So, let's merge this one.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86, Sajiyah-Salat 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 |
@varsha I am moving forward with this one but feel free to make comments if you see if we can always address in a follow up PR
Thank you camilla for merging this one. Let me know if any changes required. |
Description:
Fixes: #3460
Make install fails when crd description exceeds limit. Workaroud and why the error occur is added as suggested in this comment