apache / camel-k

Apache Camel K is a lightweight integration platform, born on Kubernetes, with serverless superpowers
https://camel.apache.org/camel-k
Apache License 2.0
863 stars 344 forks source link

Cannot load Knative configuration from file or env variable #5402

Closed matzew closed 5 months ago

matzew commented 5 months ago

What happened?

Installing pure Knative Eventing (just upstream knative eventing) and Camel-K 2.3 via helm, from scripts:

But unable to use Eventing with a simple "beer source" kamelet/pipe. Doing so gives me the following in the pod of the pipe:

2024-04-23 09:28:42,806 INFO  [org.apa.cam.mai.MainSupport] (main) Apache Camel (Main) 4.4.1 is starting
2024-04-23 09:28:42,835 INFO  [org.apa.cam.k.sup.SourcesSupport] (main) Loading routes from: SourceDefinition{name='camel-k-embedded-flow', language='yaml', type='source', location='file:/etc/camel/sources/camel-k-embedded-flow.yaml', }
2024-04-23 09:28:42,928 ERROR [org.apa.cam.qua.mai.CamelMainRuntime] (main) Failed to start application: org.apache.camel.FailedToCreateRouteException: Failed to create route binding at: >>> To[knative:event?apiVersion=eventing.knative.dev%2Fv1&cloudEventsType=com.corp.my.beer.source&kind=Broker&name=kamelet] <<< in route: Route(binding)[From[kamelet:beer-source/source] -> [To[knati... because of Failed to resolve endpoint: knative://event?apiVersion=eventing.knative.dev%2Fv1&cloudEventsType=com.corp.my.beer.source&kind=Broker&name=kamelet due to: Cannot load Knative configuration from file or env variable
...
...

In the past I had to add a few hacks to get this working, but w/ the new 2.3.0 release out there I removed those hacks yesterday: https://github.com/matzew/eventing-cloud-integraton/commit/c607fa88eb065fc2b40193b7fa5ead1dcfe74ebb

The fact that the error above says Failed to resolve endpoint: knative://event?apiVersion=eventing.knative.dev%2Fv1&cloudEventsType=com.corp.my.beer.source&kind=Broker seem to me wrong, b/c the addressable broker is there. and is ready:

k get brokers.eventing.knative.dev -A
NAMESPACE   NAME      URL                                                                        AGE   READY   REASON
default     kamelet   http://broker-ingress.knative-eventing.svc.cluster.local/default/kamelet   15m   True    

Steps to reproduce

  1. run the install from the above repo
  2. make use of the samples app folder on the repo (https://github.com/matzew/eventing-cloud-integraton/tree/main/samples/01-local-integrations)
  3. log the pod
  4. see the error

Relevant log output

exec java -cp ./resources:/etc/camel/application.properties:/etc/camel/conf.d/_resources:/etc/camel/kamelets/kamelets-bundle-beer-source-pipe-001:/etc/camel/resources:/etc/camel/sources/camel-k-embedded-flow.yaml:dependencies/app/camel-k-integration-2.3.0.jar:dependencies/lib/boot/io.github.crac.org-crac-0.1.3.jar:dependencies/lib/boot/io.quarkus.quarkus-bootstrap-runner-3.8.3.jar:dependencies/lib/boot/io.quarkus.quarkus-development-mode-spi-3.8.3.jar:dependencies/lib/boot/io.quarkus.quarkus-vertx-latebound-mdc-provider-3.8.3.jar:dependencies/lib/boot/io.smallrye.common.smallrye-common-constraint-2.1.2.jar:dependencies/lib/boot/io.smallrye.common.smallrye-common-cpu-2.1.2.jar:dependencies/lib/boot/io.smallrye.common.smallrye-common-expression-2.1.2.jar:dependencies/lib/boot/io.smallrye.common.smallrye-common-function-2.1.2.jar:dependencies/lib/boot/io.smallrye.common.smallrye-common-io-2.1.2.jar:dependencies/lib/boot/io.smallrye.common.smallrye-common-net-2.1.2.jar:dependencies/lib/boot/io.smallrye.common.smallrye-common-os-2.1.2.jar:dependencies/lib/boot/io.smallrye.common.smallrye-common-ref-2.1.2.jar:dependencies/lib/boot/jakarta.json.jakarta.json-api-2.1.3.jar:dependencies/lib/boot/org.eclipse.parsson.parsson-1.1.5.jar:dependencies/lib/boot/org.jboss.logging.jboss-logging-3.5.3.Final.jar:dependencies/lib/boot/org.jboss.logmanager.jboss-logmanager-3.0.4.Final.jar:dependencies/lib/main/com.aayushatharva.brotli4j.brotli4j-1.16.0.jar:dependencies/lib/main/com.aayushatharva.brotli4j.native-linux-x86_64-1.16.0.jar:dependencies/lib/main/com.aayushatharva.brotli4j.service-1.16.0.jar:dependencies/lib/main/com.fasterxml.jackson.core.jackson-annotations-2.16.1.jar:dependencies/lib/main/com.fasterxml.jackson.core.jackson-core-2.16.1.jar:dependencies/lib/main/com.fasterxml.jackson.core.jackson-databind-2.16.1.jar:dependencies/lib/main/com.fasterxml.jackson.dataformat.jackson-dataformat-yaml-2.16.1.jar:dependencies/lib/main/com.fasterxml.jackson.datatype.jackson-datatype-jdk8-2.16.1.jar:dependencies/lib/main/com.fasterxml.jackson.datatype.jackson-datatype-jsr310-2.16.1.jar:dependencies/lib/main/com.fasterxml.jackson.module.jackson-module-parameter-names-2.16.1.jar:dependencies/lib/main/com.github.mifmif.generex-1.0.2.jar:dependencies/lib/main/commons-codec.commons-codec-1.16.1.jar:dependencies/lib/main/commons-io.commons-io-2.15.1.jar:dependencies/lib/main/dk.brics.automaton.automaton-1.11-8.jar:dependencies/lib/main/io.fabric8.kubernetes-client-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-client-api-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-httpclient-vertx-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-model-admissionregistration-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-model-apiextensions-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-model-apps-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-model-autoscaling-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-model-batch-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-model-certificates-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-model-common-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-model-coordination-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-model-core-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-model-discovery-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-model-events-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-model-extensions-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-model-flowcontrol-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-model-gatewayapi-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-model-metrics-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-model-networking-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-model-node-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-model-policy-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-model-rbac-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-model-resource-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-model-scheduling-6.10.0.jar:dependencies/lib/main/io.fabric8.kubernetes-model-storageclass-6.10.0.jar:dependencies/lib/main/io.fabric8.openshift-client-6.10.0.jar:dependencies/lib/main/io.fabric8.openshift-client-api-6.10.0.jar:dependencies/lib/main/io.fabric8.openshift-model-6.10.0.jar:dependencies/lib/main/io.fabric8.openshift-model-clusterautoscaling-6.10.0.jar:dependencies/lib/main/io.fabric8.openshift-model-config-6.10.0.jar:dependencies/lib/main/io.fabric8.openshift-model-console-6.10.0.jar:dependencies/lib/main/io.fabric8.openshift-model-installer-6.10.0.jar:dependencies/lib/main/io.fabric8.openshift-model-machine-6.10.0.jar:dependencies/lib/main/io.fabric8.openshift-model-machineconfig-6.10.0.jar:dependencies/lib/main/io.fabric8.openshift-model-monitoring-6.10.0.jar:dependencies/lib/main/io.fabric8.openshift-model-operatorhub-6.10.0.jar:dependencies/lib/main/io.fabric8.openshift-model-storageversionmigrator-6.10.0.jar:dependencies/lib/main/io.fabric8.openshift-model-tuned-6.10.0.jar:dependencies/lib/main/io.fabric8.openshift-model-whereabouts-6.10.0.jar:dependencies/lib/main/io.fabric8.zjsonpatch-0.3.0.jar:dependencies/lib/main/io.netty.netty-buffer-4.1.107.Final.jar:dependencies/lib/main/io.netty.netty-codec-4.1.107.Final.jar:dependencies/lib/main/io.netty.netty-codec-dns-4.1.107.Final.jar:dependencies/lib/main/io.netty.netty-codec-haproxy-4.1.107.Final.jar:dependencies/lib/main/io.netty.netty-codec-http-4.1.107.Final.jar:dependencies/lib/main/io.netty.netty-codec-http2-4.1.107.Final.jar:dependencies/lib/main/io.netty.netty-codec-socks-4.1.107.Final.jar:dependencies/lib/main/io.netty.netty-common-4.1.107.Final.jar:dependencies/lib/main/io.netty.netty-handler-4.1.107.Final.jar:dependencies/lib/main/io.netty.netty-handler-proxy-4.1.107.Final.jar:dependencies/lib/main/io.netty.netty-resolver-4.1.107.Final.jar:dependencies/lib/main/io.netty.netty-resolver-dns-4.1.107.Final.jar:dependencies/lib/main/io.netty.netty-transport-4.1.107.Final.jar:dependencies/lib/main/io.netty.netty-transport-native-unix-common-4.1.107.Final.jar:dependencies/lib/main/io.quarkus.arc.arc-3.8.3.jar:dependencies/lib/main/io.quarkus.quarkus-apache-httpclient-3.8.3.jar:dependencies/lib/main/io.quarkus.quarkus-arc-3.8.3.jar:dependencies/lib/main/io.quarkus.quarkus-core-3.8.3.jar:dependencies/lib/main/io.quarkus.quarkus-credentials-3.8.3.jar:dependencies/lib/main/io.quarkus.quarkus-fs-util-0.0.10.jar:dependencies/lib/main/io.quarkus.quarkus-jackson-3.8.3.jar:dependencies/lib/main/io.quarkus.quarkus-jsonp-3.8.3.jar:dependencies/lib/main/io.quarkus.quarkus-kubernetes-client-3.8.3.jar:dependencies/lib/main/io.quarkus.quarkus-kubernetes-client-internal-3.8.3.jar:dependencies/lib/main/io.quarkus.quarkus-logging-json-3.8.3.jar:dependencies/lib/main/io.quarkus.quarkus-mutiny-3.8.3.jar:dependencies/lib/main/io.quarkus.quarkus-netty-3.8.3.jar:dependencies/lib/main/io.quarkus.quarkus-security-runtime-spi-3.8.3.jar:dependencies/lib/main/io.quarkus.quarkus-smallrye-context-propagation-3.8.3.jar:dependencies/lib/main/io.quarkus.quarkus-vertx-3.8.3.jar:dependencies/lib/main/io.quarkus.quarkus-vertx-http-3.8.3.jar:dependencies/lib/main/io.quarkus.quarkus-virtual-threads-3.8.3.jar:dependencies/lib/main/io.quarkus.security.quarkus-security-2.0.3.Final.jar:dependencies/lib/main/io.smallrye.common.smallrye-common-annotation-2.1.2.jar:dependencies/lib/main/io.smallrye.common.smallrye-common-classloader-2.1.2.jar:dependencies/lib/main/io.smallrye.common.smallrye-common-vertx-context-2.1.2.jar:dependencies/lib/main/io.smallrye.config.smallrye-config-3.5.4.jar:dependencies/lib/main/io.smallrye.config.smallrye-config-common-3.5.4.jar:dependencies/lib/main/io.smallrye.config.smallrye-config-core-3.5.4.jar:dependencies/lib/main/io.smallrye.config.smallrye-config-source-yaml-3.5.4.jar:dependencies/lib/main/io.smallrye.reactive.mutiny-2.5.8.jar:dependencies/lib/main/io.smallrye.reactive.mutiny-smallrye-context-propagation-2.5.8.jar:dependencies/lib/main/io.smallrye.reactive.smallrye-mutiny-vertx-auth-common-3.10.0.jar:dependencies/lib/main/io.smallrye.reactive.smallrye-mutiny-vertx-bridge-common-3.10.0.jar:dependencies/lib/main/io.smallrye.reactive.smallrye-mutiny-vertx-core-3.10.0.jar:dependencies/lib/main/io.smallrye.reactive.smallrye-mutiny-vertx-runtime-3.10.0.jar:dependencies/lib/main/io.smallrye.reactive.smallrye-mutiny-vertx-uri-template-3.10.0.jar:dependencies/lib/main/io.smallrye.reactive.smallrye-mutiny-vertx-web-3.10.0.jar:dependencies/lib/main/io.smallrye.reactive.smallrye-mutiny-vertx-web-common-3.10.0.jar:dependencies/lib/main/io.smallrye.reactive.vertx-mutiny-generator-3.10.0.jar:dependencies/lib/main/io.smallrye.smallrye-context-propagation-2.1.0.jar:dependencies/lib/main/io.smallrye.smallrye-context-propagation-api-2.1.0.jar:dependencies/lib/main/io.smallrye.smallrye-context-propagation-storage-2.1.0.jar:dependencies/lib/main/io.smallrye.smallrye-fault-tolerance-vertx-6.2.6.jar:dependencies/lib/main/io.vertx.vertx-auth-common-4.5.4.jar:dependencies/lib/main/io.vertx.vertx-bridge-common-4.5.4.jar:dependencies/lib/main/io.vertx.vertx-codegen-4.5.4.jar:dependencies/lib/main/io.vertx.vertx-core-4.5.4.jar:dependencies/lib/main/io.vertx.vertx-uri-template-4.5.4.jar:dependencies/lib/main/io.vertx.vertx-web-4.5.4.jar:dependencies/lib/main/io.vertx.vertx-web-client-4.5.4.jar:dependencies/lib/main/io.vertx.vertx-web-common-4.5.4.jar:dependencies/lib/main/jakarta.activation.jakarta.activation-api-2.1.2.jar:dependencies/lib/main/jakarta.annotation.jakarta.annotation-api-2.1.1.jar:dependencies/lib/main/jakarta.el.jakarta.el-api-5.0.1.jar:dependencies/lib/main/jakarta.enterprise.jakarta.enterprise.cdi-api-4.0.1.jar:dependencies/lib/main/jakarta.enterprise.jakarta.enterprise.lang-model-4.0.1.jar:dependencies/lib/main/jakarta.inject.jakarta.inject-api-2.0.1.jar:dependencies/lib/main/jakarta.interceptor.jakarta.interceptor-api-2.1.0.jar:dependencies/lib/main/jakarta.servlet.jakarta.servlet-api-6.0.0.jar:dependencies/lib/main/jakarta.transaction.jakarta.transaction-api-2.0.1.jar:dependencies/lib/main/jakarta.xml.bind.jakarta.xml.bind-api-4.0.1.jar:dependencies/lib/main/org.apache.camel.camel-api-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-attachments-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-base-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-base-engine-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-bean-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-cloud-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-cloudevents-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-cluster-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-componentdsl-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-core-catalog-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-core-engine-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-core-languages-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-core-model-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-core-processor-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-core-reifier-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-dsl-support-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-endpointdsl-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-file-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-health-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-http-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-http-base-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-http-common-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-kamelet-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-knative-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-knative-api-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-knative-http-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-kubernetes-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-main-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-management-api-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-microprofile-config-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-support-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-timer-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-tooling-model-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-util-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-util-json-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-xml-jaxp-util-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-yaml-dsl-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-yaml-dsl-common-4.4.1.jar:dependencies/lib/main/org.apache.camel.camel-yaml-dsl-deserializers-4.4.1.jar:dependencies/lib/main/org.apache.camel.k.camel-k-core-3.8.1.jar:dependencies/lib/main/org.apache.camel.k.camel-k-core-api-3.8.1.jar:dependencies/lib/main/org.apache.camel.k.camel-k-core-support-3.8.1.jar:dependencies/lib/main/org.apache.camel.k.camel-k-runtime-3.8.1.jar:dependencies/lib/main/org.apache.camel.quarkus.camel-quarkus-bean-3.8.1.jar:dependencies/lib/main/org.apache.camel.quarkus.camel-quarkus-cloudevents-3.8.1.jar:dependencies/lib/main/org.apache.camel.quarkus.camel-quarkus-core-3.8.1.jar:dependencies/lib/main/org.apache.camel.quarkus.camel-quarkus-core-cloud-3.8.1.jar:dependencies/lib/main/org.apache.camel.quarkus.camel-quarkus-http-3.8.1.jar:dependencies/lib/main/org.apache.camel.quarkus.camel-quarkus-http-common-3.8.1.jar:dependencies/lib/main/org.apache.camel.quarkus.camel-quarkus-kamelet-3.8.1.jar:dependencies/lib/main/org.apache.camel.quarkus.camel-quarkus-knative-3.8.1.jar:dependencies/lib/main/org.apache.camel.quarkus.camel-quarkus-kubernetes-3.8.1.jar:dependencies/lib/main/org.apache.camel.quarkus.camel-quarkus-support-commons-logging-3.8.1.jar:dependencies/lib/main/org.apache.camel.quarkus.camel-quarkus-support-httpclient-3.8.1.jar:dependencies/lib/main/org.apache.camel.quarkus.camel-quarkus-timer-3.8.1.jar:dependencies/lib/main/org.apache.camel.quarkus.camel-quarkus-yaml-dsl-3.8.1.jar:dependencies/lib/main/org.apache.commons.commons-compress-1.26.1.jar:dependencies/lib/main/org.apache.commons.commons-lang3-3.14.0.jar:dependencies/lib/main/org.apache.httpcomponents.client5.httpclient5-5.2.1.jar:dependencies/lib/main/org.apache.httpcomponents.core5.httpcore5-5.2.1.jar:dependencies/lib/main/org.apache.httpcomponents.core5.httpcore5-h2-5.2.4.jar:dependencies/lib/main/org.apache.httpcomponents.httpclient-4.5.14.jar:dependencies/lib/main/org.apache.httpcomponents.httpcore-4.4.16.jar:dependencies/lib/main/org.brotli.dec-0.1.2.jar:dependencies/lib/main/org.eclipse.angus.angus-activation-2.0.1.jar:dependencies/lib/main/org.eclipse.microprofile.config.microprofile-config-api-3.0.3.jar:dependencies/lib/main/org.eclipse.microprofile.context-propagation.microprofile-context-propagation-api-1.3.jar:dependencies/lib/main/org.jboss.logging.commons-logging-jboss-logging-1.0.0.Final.jar:dependencies/lib/main/org.jboss.logging.jboss-logging-annotations-2.2.1.Final.jar:dependencies/lib/main/org.jboss.slf4j.slf4j-jboss-logmanager-2.0.0.Final.jar:dependencies/lib/main/org.jboss.threads.jboss-threads-3.5.1.Final.jar:dependencies/lib/main/org.slf4j.slf4j-api-2.0.6.jar:dependencies/lib/main/org.snakeyaml.snakeyaml-engine-2.7.jar:dependencies/lib/main/org.wildfly.common.wildfly-common-1.7.0.Final.jar:dependencies/lib/main/org.yaml.snakeyaml-2.2.jar:dependencies/quarkus-app-dependencies.txt:dependencies/quarkus-run.jar:dependencies/quarkus/generated-bytecode.jar:dependencies/quarkus/quarkus-application.dat:dependencies/quarkus/transformed-bytecode.jar io.quarkus.bootstrap.runner.QuarkusEntryPoint
2024-04-23 09:28:42,800 INFO  [org.apa.cam.k.Runtime] (main) Apache Camel K Runtime 3.8.1
2024-04-23 09:28:42,804 INFO  [org.apa.cam.qua.cor.CamelBootstrapRecorder] (main) Bootstrap runtime: org.apache.camel.quarkus.main.CamelMainRuntime
2024-04-23 09:28:42,806 INFO  [org.apa.cam.mai.MainSupport] (main) Apache Camel (Main) 4.4.1 is starting
2024-04-23 09:28:42,835 INFO  [org.apa.cam.k.sup.SourcesSupport] (main) Loading routes from: SourceDefinition{name='camel-k-embedded-flow', language='yaml', type='source', location='file:/etc/camel/sources/camel-k-embedded-flow.yaml', }
2024-04-23 09:28:42,928 ERROR [org.apa.cam.qua.mai.CamelMainRuntime] (main) Failed to start application: org.apache.camel.FailedToCreateRouteException: Failed to create route binding at: >>> To[knative:event?apiVersion=eventing.knative.dev%2Fv1&cloudEventsType=com.corp.my.beer.source&kind=Broker&name=kamelet] <<< in route: Route(binding)[From[kamelet:beer-source/source] -> [To[knati... because of Failed to resolve endpoint: knative://event?apiVersion=eventing.knative.dev%2Fv1&cloudEventsType=com.corp.my.beer.source&kind=Broker&name=kamelet due to: Cannot load Knative configuration from file or env variable
    at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:228)
    at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:79)
    at org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49)
    at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:728)
    at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:594)
    at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2385)
    at org.apache.camel.quarkus.core.FastCamelContext.doInit(FastCamelContext.java:194)
    at org.apache.camel.support.service.BaseService.init(BaseService.java:78)
    at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2021)
    at org.apache.camel.support.service.BaseService.start(BaseService.java:105)
    at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2040)
    at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:212)
    at org.apache.camel.quarkus.main.CamelMain.doStart(CamelMain.java:94)
    at org.apache.camel.support.service.BaseService.start(BaseService.java:113)
    at org.apache.camel.quarkus.main.CamelMain.startEngine(CamelMain.java:140)
    at org.apache.camel.quarkus.main.CamelMainRuntime.start(CamelMainRuntime.java:49)
    at org.apache.camel.quarkus.core.CamelBootstrapRecorder.start(CamelBootstrapRecorder.java:45)
    at io.quarkus.deployment.steps.CamelBootstrapProcessor$boot173480958.deploy_0(Unknown Source)
    at io.quarkus.deployment.steps.CamelBootstrapProcessor$boot173480958.deploy(Unknown Source)
    at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
    at io.quarkus.runtime.Application.start(Application.java:101)
    at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:111)
    at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
    at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
    at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
    at io.quarkus.runner.GeneratedMain.main(Unknown Source)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:62)
    at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:33)
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: knative://event?apiVersion=eventing.knative.dev%2Fv1&cloudEventsType=com.corp.my.beer.source&kind=Broker&name=kamelet due to: Cannot load Knative configuration from file or env variable
    at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:830)
    at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:730)
    at org.apache.camel.support.CamelContextHelper.resolveEndpoint(CamelContextHelper.java:123)
    at org.apache.camel.reifier.SendReifier.resolveEndpoint(SendReifier.java:47)
    at org.apache.camel.reifier.SendReifier.createProcessor(SendReifier.java:37)
    at org.apache.camel.reifier.ProcessorReifier.makeProcessor(ProcessorReifier.java:879)
    at org.apache.camel.reifier.ProcessorReifier.addRoutes(ProcessorReifier.java:619)
    at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:224)
    ... 31 more
Caused by: java.lang.IllegalStateException: Cannot load Knative configuration from file or env variable
    at org.apache.camel.component.knative.KnativeComponent.getKnativeConfiguration(KnativeComponent.java:288)
    at org.apache.camel.component.knative.KnativeComponent.createEndpoint(KnativeComponent.java:226)
    at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:170)
    at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:796)
    ... 38 more

2024-04-23 09:28:42,949 ERROR [io.qua.run.Application] (main) Failed to start application (with profile [prod]): java.lang.RuntimeException: Failed to start quarkus
    at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
    at io.quarkus.runtime.Application.start(Application.java:101)
    at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:111)
    at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
    at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
    at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
    at io.quarkus.runner.GeneratedMain.main(Unknown Source)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:62)
    at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:33)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: org.apache.camel.FailedToCreateRouteException: Failed to create route binding at: >>> To[knative:event?apiVersion=eventing.knative.dev%2Fv1&cloudEventsType=com.corp.my.beer.source&kind=Broker&name=kamelet] <<< in route: Route(binding)[From[kamelet:beer-source/source] -> [To[knati... because of Failed to resolve endpoint: knative://event?apiVersion=eventing.knative.dev%2Fv1&cloudEventsType=com.corp.my.beer.source&kind=Broker&name=kamelet due to: Cannot load Knative configuration from file or env variable
    at org.apache.camel.quarkus.core.CamelBootstrapRecorder.start(CamelBootstrapRecorder.java:47)
    at io.quarkus.deployment.steps.CamelBootstrapProcessor$boot173480958.deploy_0(Unknown Source)
    at io.quarkus.deployment.steps.CamelBootstrapProcessor$boot173480958.deploy(Unknown Source)
    ... 13 more
Caused by: java.lang.RuntimeException: org.apache.camel.FailedToCreateRouteException: Failed to create route binding at: >>> To[knative:event?apiVersion=eventing.knative.dev%2Fv1&cloudEventsType=com.corp.my.beer.source&kind=Broker&name=kamelet] <<< in route: Route(binding)[From[kamelet:beer-source/source] -> [To[knati... because of Failed to resolve endpoint: knative://event?apiVersion=eventing.knative.dev%2Fv1&cloudEventsType=com.corp.my.beer.source&kind=Broker&name=kamelet due to: Cannot load Knative configuration from file or env variable
    at org.apache.camel.quarkus.main.CamelMainRuntime.start(CamelMainRuntime.java:65)
    at org.apache.camel.quarkus.core.CamelBootstrapRecorder.start(CamelBootstrapRecorder.java:45)
    ... 15 more
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route binding at: >>> To[knative:event?apiVersion=eventing.knative.dev%2Fv1&cloudEventsType=com.corp.my.beer.source&kind=Broker&name=kamelet] <<< in route: Route(binding)[From[kamelet:beer-source/source] -> [To[knati... because of Failed to resolve endpoint: knative://event?apiVersion=eventing.knative.dev%2Fv1&cloudEventsType=com.corp.my.beer.source&kind=Broker&name=kamelet due to: Cannot load Knative configuration from file or env variable
    at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:228)
    at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:79)
    at org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49)
    at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:728)
    at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:594)
    at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2385)
    at org.apache.camel.quarkus.core.FastCamelContext.doInit(FastCamelContext.java:194)
    at org.apache.camel.support.service.BaseService.init(BaseService.java:78)
    at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2021)
    at org.apache.camel.support.service.BaseService.start(BaseService.java:105)
    at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2040)
    at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:212)
    at org.apache.camel.quarkus.main.CamelMain.doStart(CamelMain.java:94)
    at org.apache.camel.support.service.BaseService.start(BaseService.java:113)
    at org.apache.camel.quarkus.main.CamelMain.startEngine(CamelMain.java:140)
    at org.apache.camel.quarkus.main.CamelMainRuntime.start(CamelMainRuntime.java:49)
    ... 16 more
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: knative://event?apiVersion=eventing.knative.dev%2Fv1&cloudEventsType=com.corp.my.beer.source&kind=Broker&name=kamelet due to: Cannot load Knative configuration from file or env variable
    at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:830)
    at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:730)
    at org.apache.camel.support.CamelContextHelper.resolveEndpoint(CamelContextHelper.java:123)
    at org.apache.camel.reifier.SendReifier.resolveEndpoint(SendReifier.java:47)
    at org.apache.camel.reifier.SendReifier.createProcessor(SendReifier.java:37)
    at org.apache.camel.reifier.ProcessorReifier.makeProcessor(ProcessorReifier.java:879)
    at org.apache.camel.reifier.ProcessorReifier.addRoutes(ProcessorReifier.java:619)
    at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:224)
    ... 31 more
Caused by: java.lang.IllegalStateException: Cannot load Knative configuration from file or env variable
    at org.apache.camel.component.knative.KnativeComponent.getKnativeConfiguration(KnativeComponent.java:288)
    at org.apache.camel.component.knative.KnativeComponent.createEndpoint(KnativeComponent.java:226)
    at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:170)
    at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:796)

Camel K version

2.3.0

christophd commented 5 months ago

Hello Matthias,

I think this error is happening when K_SINK envvar injection is not happening for the Integration deployment. I recall that the K_SINK injection requires Knative serving to be available on the cluster, too.

You should be able to explicitly set the Knative broker as a property on the Pipe sink reference. I need to check for the property name.

Do you have any idea how we could handle the Knative broker URL resolving for the Pipe when K_SINK and Knative serving is not available?

matzew commented 5 months ago

I have no usage of Knative Serving, as that is a separate component. and I dont want to use it :smile:

The pipe has the broker already, as reference:

apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
  name: beer-source-pipe
spec:
  source:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      name: beer-source
  sink:
    properties:
      cloudEventsType: com.corp.my.beer.source
    ref:
      kind: Broker
      apiVersion: eventing.knative.dev/v1
      name: kamelet

This was working in the past, however for that I had to run a fewer other hacks, see the referenced commit above. (Those I now removed)

christophd commented 5 months ago

I guess one of the hacks was to also install Knative serving. I do not fully understand how the Camel K operator should resolve the Knative broker URL if there is no serving available (with K_SINK SinkBinding injection).

matzew commented 5 months ago

There was no serving installed. I just added the "serivce" CRD, but not more.

A broker is an addressable type, see: https://knative.dev/docs/concepts/duck-typing/#addressable and there are golang apis to resolve the url from those

Really no serving is needed

matzew commented 5 months ago

We have a resolver for addressables: https://github.com/knative/pkg/blob/main/resolver/addressable_resolver.go

And the addressable is basically a named type w/ a apis.URL (and optional things like certs): https://github.com/knative/pkg/blob/main/apis/duck/v1/addressable_types.go#L40-L45

You can use it like here, where we want the addressable / URI from the subscriber reference of the Trigger:

    addressable, err := r.Resolver.AddressableFromDestinationV1(ctx, trigger.Spec.Subscriber, trigger)
...

That way you can resolve the URL. However, I guess you do not directly use our types (e.g. Destination or even KRefs), but we have wrappers for that. see URIFromObjectReference in the resolver.go file

christophd commented 5 months ago

okay, many thanks for the clarification. Addressable resolver makes sense and I recall that we have that in place somewhere else in Camel K, too.

For the K_SINK injection - just to be sure. Does that mean that the K_SINK is injected by Knative eventing? Serving does not deal with K_SINK at all?

Could be that we create the SinkBinding only when Knative serving is found on the cluster and that needs to be fixed in Camel K.

lburgazzoli commented 5 months ago

From an historical POV, the initial integration with Knative was based on the addressable resolver (hand written) which lead to the Knative Environment as we were collecting much more info about the sink. Then, KNative added the K_SINK injection and we switched to it as it was much simpler from the operator POV.

matzew commented 5 months ago

OK. After I sorted the RBAC in #5410 and I was able to work around on this, by simply applying the Serving CRD. This should not be needed, but it gets me beyond the point.

kubectl apply -f https://raw.githubusercontent.com/knative/serving/main/config/core/300-resources/service.yaml
christophd commented 5 months ago

I am having a look why Camel K requires Knative serving to use K_SINK SinkBinding