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
868 stars 348 forks source link

Integration Platform issues when using the Operator #3297

Closed utherp0 closed 2 years ago

utherp0 commented 2 years ago

This is an odd one; on OpenShift 4.10 when you install Camel-K/Integration it does not create by default an Integration Platform. When you create a default one and then create an Integration using 'kamel run' (in this case a simple Event reader - see https://github.com/utherp0/functest2/blob/main/camelk/EventReader.java) the integration fails. If you then delete the Integration Platform, and then run the Integration without a platform present the Operator will create an IP and the Integration runs.

However, if you create an Integration before you create a default Integration Platform the integration fails to start.

This is always repeatable on OCP4.10.

christophd commented 2 years ago

When no IntegrationPlatform is present it gets created automatically with the 1st integration. So it should also work if you just install the operator and run the integration. The default platform gets created automatically as you have already mentioned.

Maybe the custom IntegrationPlatform that you have created manually is different to the automatically created one? Could you please check any difference that might cause the error?

Also when creating an IntegrationPlatform manually please mind that the platform needs to be in "Ready" state before starting an integration.

Could you please reproduce the error once again and share the operator logs so we can see why the integration was failing.

Many thanks!

utherp0 commented 2 years ago

So, I think the problem I am seeing is that if I create a default ip before I run the integration it fails; the default is just 'as is', taking all the defaults on the Ux for the ip.

Creating one with no ip present does create the ip:

uther@ilawson-mac camelk % oc project camelktest Now using project "camelktest" on server "https://api.cluster-nq5hk.nq5hk.sandbox542.opentlc.com:6443". uther@ilawson-mac camelk % oc get ip No resources found in camelktest namespace. uther@ilawson-mac camelk % kamel run EventReader.java integration "event-reader" created uther@ilawson-mac camelk % oc get ip NAME PHASE camel-k Ready uther@ilawson-mac camelk % oc get integration NAME PHASE KIT REPLICAS event-reader Building Kit kit-ca69lbu4gbef2b5j58f0

christophd commented 2 years ago

would be good to see the error from the logs so I can have an idea what went wrong.

Are you using a global operator? where is that operator running (maybe in namespace camelktest)?

utherp0 commented 2 years ago

Yup - I'm installing operator namespace bound, i.e. the operator is running locally. Once the test has completed (the build is taking a while) I'll spin up another namespace and create the ip first which should cause the problem, and will get the logs

utherp0 commented 2 years ago

So, replicated it; there are no errors in the Operator log other than a repeat of:

{"level":"error","ts":1653463966.870432,"logger":"cmd","msg":"couldn't get resource list for metrics.k8s.io/v1beta1: the server is currently unable to handle the request\n","stacktrace":"github.com/apache/camel-k/vendor/k8s.io/klog/v2.(loggingT).output\n\tgithub.com/apache/camel-k/vendor/k8s.io/klog/v2/klog.go:914\ngithub.com/apache/camel-k/vendor/k8s.io/klog/v2.(loggingT).printDepth\n\tgithub.com/apache/camel-k/vendor/k8s.io/klog/v2/klog.go:733\ngithub.com/apache/camel-k/vendor/k8s.io/klog/v2.ErrorDepth\n\tgithub.com/apache/camel-k/vendor/k8s.io/klog/v2/klog.go:1451\ngithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/runtime.logError\n\tgithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:114\ngithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/runtime.HandleError\n\tgithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:108\ngithub.com/apache/camel-k/vendor/k8s.io/client-go/discovery/cached/memory.(*memCacheClient).ServerResourcesForGroupVersion\n\tgithub.com/apache/camel-k/vendor/k8s.io/client-go/discovery/cached/memory/memcache.go:101\ngithub.com/apache/camel-k/vendor/k8s.io/client-go/discovery.fetchGroupVersionResources.func1\n\tgithub.com/apache/camel-k/vendor/k8s.io/client-go/discovery/discovery_client.go:361"}

The Camel-k Pod is in crash loop backoff (the behaviour I see when I have the ip issues):

Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: knative://event/techtalkevent due to: Cannot load Knative configuration from file or env variable at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:962) at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:844) at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:177) at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ... 30 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:278) at org.apache.camel.component.knative.KnativeComponent.createEndpoint(KnativeComponent.java:226) at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:928) ... 35 more

This error goes away if I remove the ip I created and use 'kamel run' to create the Integration. It only occurs when I create an ip from the Operator page and take all the defaults (i.e. just hit create). When I do that the ip does create - it is in a state of running when I create the integration.

christophd commented 2 years ago

what does it mean if you say the operator is running locally? you are running the operator namespace scoped on a single namespace or on your local machine?

utherp0 commented 2 years ago

The Operator is deployed into the namespace rather than across the Cluster, by local I mean namespace bound

Screenshot 2022-05-25 at 09 12 20
mathianasj commented 2 years ago

i am seeing this issue as well

christophd commented 2 years ago

could you please do a kubectl get integrationplatform camel-k -o yaml for both the manual created ip and the automatically created ip. This will print the custom resource and we can see any difference that makes the one succeed while the other fails

mathianasj commented 2 years ago

I figured out the problem I missed in the documentation that if installed on openshift I did not create an IP once I removed it everything started working.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale due to 90 days of inactivity. It will be closed if no further activity occurs within 15 days. If you think that’s incorrect or the issue should never stale, please simply write any comment. Thanks for your contributions!