Hi all. I am attempting to implement a route which will receive k8 events and
simply write them to system:out.
The application is running in our cluster, however, it is not receiving any
events. I'm hoping to get some info on how I might debug this issue.
For reference, here is the route:
from("kubernetes-events:client&namespace=my-namespace")
.setHeader(KubernetesConstants.KUBERNETES_NAMESPACE_NAME,
constant("my-namespace"))
.process(new KubernertesProcessor())
.to("stream:out");
}
public static class KubernertesProcessor implements Processor {
@Override
public void process(Exchange exchange) throws Exception {
Message in = exchange.getIn();
Event event = exchange.getIn().getBody(Event.class);
log.info("Got event with event name: {} and action {}",
event.getMetadata().getName(),
in.getHeader(KubernetesConstants.KUBERNETES_EVENT_ACTION));
}
}
and some logs that may be of use:
{"timestamp":"2024-07-29
16:33:24.734","level":"DEBUG","thread":"main","logger":"org.apache.camel.impl.engine.InternalRouteStartupManager","message":"Warming
up route id: route1 having autoStartup=true","context":"default"}
{"timestamp":"2024-07-29
16:33:24.735","level":"DEBUG","thread":"main","logger":"org.apache.camel.component.kubernetes.KubernetesHelper","message":"Create
Kubernetes client with the following Configuration: KubernetesConfiguration
[masterUrl=client&namespace=my-namespace, category=null, kubernetesClient=null,
username=null, password=null, operation=null, apiVersion=null, caCertData=null,
caCertFile=null, clientCertData=null, clientCertFile=null, clientKeyAlgo=null,
clientKeyData=null, clientKeyFile=null, clientKeyPassphrase=null,
oauthToken=null, trustCerts=null, namespace=null, labelKey=null,
labelValue=null, resourceName=null, portName=null, dnsDomain=null, poolSize=1,
connectionTimeout=null]","context":"default"}
{"timestamp":"2024-07-29
16:33:25.337","level":"DEBUG","thread":"main","logger":"org.apache.camel.impl.engine.InternalRouteStartupManager","message":"Route:
route1 >>> Route[kubernetes-events://client&namespace=my-namespace ->
null]","context":"default"}
{"timestamp":"2024-07-29
16:33:25.337","level":"DEBUG","thread":"main","logger":"org.apache.camel.impl.engine.InternalRouteStartupManager","message":"Starting
consumer (order: 1000) on route: route1","context":"default"}
{"timestamp":"2024-07-29
16:33:25.338","level":"DEBUG","thread":"main","logger":"org.apache.camel.support.DefaultConsumer","message":"Build
consumer:
Consumer[kubernetes-events://client&namespace=my-namespace]","context":"default"}
{"timestamp":"2024-07-29
16:33:25.338","level":"DEBUG","thread":"main","logger":"org.apache.camel.support.DefaultConsumer","message":"Init
consumer:
Consumer[kubernetes-events://client&namespace=my-namespace]","context":"default"}
{"timestamp":"2024-07-29
16:33:25.339","level":"DEBUG","thread":"main","logger":"org.apache.camel.support.DefaultConsumer","message":"Starting
consumer:
Consumer[kubernetes-events://client&namespace=my-namespace]","context":"default"}
{"timestamp":"2024-07-29
16:33:25.339","level":"DEBUG","thread":"main","logger":"org.apache.camel.impl.engine.BaseExecutorServiceManager","message":"Created
new ThreadPool for source: kubernetes-events://client&namespace=my-namespace
with name: KubernetesConsumer. ->
org.apache.camel.util.concurrent.RejectableThreadPoolExecutor@46b7c89b[Running<mailto:org.apache.camel.util.concurrent.RejectableThreadPoolExecutor@46b7c89b[Running>,
pool size = 0, active threads = 0, queued tasks = 0, completed tasks =
0][KubernetesConsumer]","context":"default"}
{"timestamp":"2024-07-29
16:33:25.343","level":"DEBUG","thread":"main","logger":"org.apache.camel.impl.engine.InternalRouteStartupManager","message":"Route:
route1 started and consuming from:
kubernetes-events://client&namespace=my-namespace","context":"default"}
Any help/guidance is greatly appreciated.
This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or intended recipient’s authorized agent, the reader is hereby
notified that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.