Skip to content

Commit

Permalink
Update docs/book/src/faq.md
Browse files Browse the repository at this point in the history
Co-authored-by: Camila Macedo <[email protected]>
  • Loading branch information
Sajiyah-Salat and camilamacedo86 committed Aug 22, 2023
1 parent c651393 commit c8d04e6
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion docs/book/src/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,21 @@ However, note that this problem is fixed and will not occur if you deploy the pr
## 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?
Kubernetes api has a size limit and if the CRD is too big with so many long descriptions it will cause the failure.
The Kubernetes API has a size limit. Then, when the apply is used the API will add the annotation last-applied-configuration with all previous configuration which is exceeding this amount. [More info](https://kubernetes.io/docs/tasks/manage-kubernetes-objects/declarative-config/#how-to-create-objects)
Therefore, you have a few options to workround this scenario such as:
- You can use the option `maxDescLen=0` to remove the description of your CRDs. Following an example:
```shell

.PHONY: manifests
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
# Note that the option maxDescLen=0 was added in the default scaffold in order to sort out the issue
# Too long: must have at most 262144 bytes. By using kubectl apply to create / update resources an annotation
# is created by K8s API to store the latest version of the resource ( kubectl.kubernetes.io/last-applied-configuration).
# 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.

Expand Down

0 comments on commit c8d04e6

Please sign in to comment.