tadayosi commented on issue #2229: URL: https://github.com/apache/camel-k/issues/2229#issuecomment-1177326560
To wrap up the discussions at the pull req #2831, there are three main problems with supporting Flow schema in CRDs: 1. **The sizes of CRDs will become bloated by introducing the Flow schema;** Right now the original Flow JSON schema [camelYamlDsl.json](https://github.com/apache/camel/blob/main/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json) is about 220KB, but due to [lack of $ref support in CRD](https://github.com/kubernetes/kubernetes/issues/62872) when it's embedded to Camel K CRDs it bloats them, e.g. for Integration CRD it'll become 4.1MB according to #2831. 2. **The "polymorphic" types (`anyOf` and `oneOf`) used in the original Flow schema [camelYamlDsl.json](https://github.com/apache/camel/blob/main/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json) aren't supported in CRD;** One workaround would be to create an "opinionated" Flow schema that strips all the "polymorphic" types from the original schema, deciding which one should be left for each of them. 3. **The Flow schema is tied to a specific Camel version;** Meanwhile Camel K supports changing the Camel K runtime version, so the CRDs cannot be tied to a specific Flow schema version. While the 2nd one was considered as the most difficult technical obstacle, I think actually the 1st one is also the showstopper. It's because the upper limit for the size of a CRD is **~1MB** and OLM imposes the limitation of **~4MB** on the total size of a bundle [1]. Right now, the Camel K OLM bundle is already over 1MB even though it still has only one version `v1`. If we want to evolve with multiple versions we'll soon go into the size issue. That seems to make support for Flow schema in CRDs technically almost impossible. [1] https://groups.google.com/g/operator-framework/c/79UO6oGwuTs In conclusion, I think supporting Flow schema in CRDs is not a good idea for Camel K. I'd propose to reject this request because of the reasons above. YAML DSL routes can be developed somewhere outside of the K8s limitations, such as IDEs and Karavan with full of the JSON schema support. @astefanutti @squakez @apupier Please share your feedback before closing this issue. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
