-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
metadata.annotations: Too long: must have at most 262144 bytes #2556
Comments
hI @ka-keung, It shows that you added an metadata.annotations which is bigger than the value supported by K8s API. Not sure how it could be solved via these project KB (which is a CLI to scaffolds the project ) or controller-gen (which will help scaffolds the manifest). |
@camilamacedo86 i had't do nothing but clone this repository and go to the dir docs/book/src/multiversion-tutorial/testdata/project run make install deploy |
Could you please test with go: 1.17+ < 1.18 just for we ensure that is not related? See: |
try again with version: go: v1.17.8 same result~. my step:
|
|
So, we need to check here:
WDYT? @ka-keung would you like to help on this one? |
thankyou for your answer. i also would like to improve this project , but now . i need more deep learn to find out what happend in those action @camilamacedo86 |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
As this issue is inactive for a long time. I will fix this. I was able to recreate it locally. |
/assign |
/remove-lifecycle rotten |
Hi @camilamacedo86 - I was able to recreate the issue. There are two ways through which we can fix this issue.
Please take a look at PR and let me know your thoughts. |
Just adding that |
I am following the book one to one and I got the same problem. Fixed by @ka-keung . |
Also just ran into this working my way through the tutorial. Definitely should be fixed asap |
Same here, when following the tutorial https://book.kubebuilder.io/cronjob-tutorial/running
|
I built a custom operator (https://github.com/telekom-mms/trivy-dojo-report-operator) that uses the kopf-operator (github.com/nolar/kopf/) framework. This framework can act on kubernetes-resource creation. To detect which resources were already worked on, kopf adds a the last state of the resource as an annotation or status to the resource.I cannot use the annotation-feature, because of this issue: kubernetes-sigs/kubebuilder#2556 (annotations get too long). So my proposal is to preseve unknown fields in the vulnerabilityreport-crd. This way I can add a status-field which kopf then can use to store the state.
I built a custom operator (https://github.com/telekom-mms/trivy-dojo-report-operator) that uses the kopf-operator (github.com/nolar/kopf/) framework. This framework can act on kubernetes-resource creation. To detect which resources were already worked on, kopf adds a the last state of the resource as an annotation or status to the resource.I cannot use the annotation-feature, because of this issue: kubernetes-sigs/kubebuilder#2556 (annotations get too long). So my proposal is to preseve unknown fields in the vulnerabilityreport-crd. This way I can add a status-field which kopf then can use to store the state.
I built a custom operator (https://github.com/telekom-mms/trivy-dojo-report-operator) that uses the kopf-operator (github.com/nolar/kopf/) framework. This framework can act on kubernetes-resource creation. To detect which resources were already worked on, kopf adds a the last state of the resource as an annotation or status to the resource.I cannot use the annotation-feature, because of this issue: kubernetes-sigs/kubebuilder#2556 (annotations get too long). So my proposal is to preseve unknown fields in the vulnerabilityreport-crd. This way I can add a status-field which kopf then can use to store the state.
I built a custom operator (https://github.com/telekom-mms/trivy-dojo-report-operator) that uses the kopf-operator (github.com/nolar/kopf/) framework. This framework can act on kubernetes-resource creation. To detect which resources were already worked on, kopf adds a the last state of the resource as an annotation or status to the resource.I cannot use the annotation-feature, because of this issue: kubernetes-sigs/kubebuilder#2556 (annotations get too long). So my proposal is to preseve unknown fields in the vulnerabilityreport-crd. This way I can add a status-field which kopf then can use to store the state.
Could this be fixed? Why is this issue closed when this has not been fixed? |
I was able to resolve this issue in the cronjob example by making the following changes. File: docs/book/src/cronjob-tutorial/testdata/project/Makefile ##@ Development
.PHONY: manifests
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
- $(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
+ $(CONTROLLER_GEN) rbac:roleName=manager-role crd:maxDescLen=0 webhook paths="./..." output:crd:artifacts:config=config/crd/bases
.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..." |
I solved this problem by adding comments.
|
I encountered this issue today while following the tutorial. I got the same error message as originally posted here, but I'm not sure if it's the same root cause.
I understand that the error message means that the annotations I tried to use during the But, I don't understand why they're too large. In fact, when trying to troubleshoot by searching through the code base to see the long values, I didn't find anything longer than about 50 characters. But I did notice that a few of the annotations:
cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME Therefore, I think there might be some sort of YAML generation step (I know So at this point, because I wasn't able to see at a closer level what was going on, like seeing the YAML that ends up being applied to k8s, I wasn't able to do anymore troubleshooting than this. In order to test my kustomize theory, I'd have to change the project's build setup so that I could see the YAML kustomize ends up producing, and I'm not familiar with how this project's build setup works yet. I then come here to this issue. I tried the solution described in #2556 (comment) and this worked for me.
|
I encountered exactly the same issue, too. |
This seems to happen because the
|
The info about this one is added in the docs; kubebuilder/docs/book/src/faq.md Lines 95 to 119 in a64e9ba
@mwienk could you please review and let us know if we could supplement this one |
@camilamacedo86 I'd change
into
I'm not really sure what/how it isn't supported though, everything seems to work fine when I use a server-side apply |
metadata.annotations: Too long: must have at most 262144 bytes kubernetes-sigs/kubebuilder#2556
i avoid this by: |
…es-sigs/kubebuilder#2556 (comment) for details This reverts commit 177f407.
…ubernetes-sigs/kubebuilder#2556 (comment) for details" This reverts commit 73e0045.
What broke? What's expected?
clone this project on the machine, an go to dir docs/book/src/multiversion-tutorial/testdata/project .
make install deploy
; then this error appearReproducing this issue
No response
KubeBuilder (CLI) Version
3.3.0
PROJECT version
3
Plugin versions
No response
Other versions
k8s: v1.21.9
go: 1.16.2
kustomize: v4.5.2
centos: 3.10.0-693.el7.x86_64
Extra Labels
No response
The text was updated successfully, but these errors were encountered: