java icon indicating copy to clipboard operation
java copied to clipboard

crd to java error

Open chestarss opened this issue 6 months ago • 1 comments
trafficstars

Not sure what to do next? 😅 Check out https://kind.sigs.k8s.io/docs/user/quick-start/ The CustomResourceDefinition "sparkapplications.sparkoperator.k8s.io" is invalid: metadata.annotations: Too long: must have at most 262144 bytes Error: Process completed with exit code 1.

crd file: https://raw.githubusercontent.com/kubeflow/spark-operator/refs/heads/release-2.1/charts/spark-operator-chart/crds/sparkoperator.k8s.io_sparkapplications.yaml

chestarss avatar May 18 '25 09:05 chestarss

Please have a look here: https://github.com/kubernetes-client/java/issues/2619#issuecomment-2232483076

brendandburns avatar May 18 '25 15:05 brendandburns

Hi @chestarss,

The error metadata.annotations: Too long: must have at most 262144 bytes means that the annotations field in your CRD metadata exceeds the Kubernetes size limit.

This is a common issue when the CRD file contains very large annotations or embedded schemas.

A few suggestions to fix or work around this:

1 - Reduce the size of annotations — check if there are large annotations in your CRD YAML (e.g., full OpenAPI schema embedded in annotations) and remove or simplify them.

2 - Use kubectl apply --validate=false — sometimes this helps if validation fails on large CRDs (though not recommended for production).

3 - Split the CRD if possible — modularize it to reduce the annotation size.

4 - Check if there’s an updated or slimmed-down CRD version in the spark-operator repo.

5 - If generating Java classes from the CRD, consider using tools like kubebuilder or openapi-generator to avoid including large annotations in the generated code.

If you want, I can help you inspect the CRD file and suggest how to slim it down or handle it better.

Storm-Dev6 avatar Jul 21 '25 15:07 Storm-Dev6

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Oct 19 '25 15:10 k8s-triage-robot