<p>I'm attempting to trigger a Kubeless function (written as a Java method) and it doesn't seem to be working. I've tried everything I can think to try, but I've run out of ideas. Below is the Java method (it's basically an echo service, for now).</p>
<pre><code>package io.kubeless;

import io.kubeless.Context;
import io.kubeless.Event;

public class MyHandler {
    public String handle(Event event, Context context) {
        return event.Data;
    }
}
</code></pre>
<p>The method was deployed using the following:</p>
<pre><code>$ kubeless function deploy my-handler --runtime java1.8 --handler MyHandler.handle --from-file src/main/java/io/kubeless/MyHandler.java
</code></pre>
<p>I have verified it works by running the following:</p>
<pre><code>$ kubeless function call my-handler --data &quot;It works&quot;
$ kubectl logs my-handler-6f67d567c5-r8cdb
    0 [pool-1-thread-38] INFO io.kubeless.Handler  - Response: It works
</code></pre>
<p>I then <a href="https://kubeless.io/docs/pubsub-functions/" rel="nofollow noreferrer">created a Kafka trigger</a> and published a message to it using the following.</p>
<pre><code>$ kubeless trigger kafka create test --function-selector created-by=kubeless,function=my-handler --trigger-topic test-topic
$ kubeless topic publish --topic test-topic --data &quot;Hello from Kafka&quot;
$ kubectl logs my-handler-6f67d567c5-r8cdb
    0 [pool-1-thread-38] INFO io.kubeless.Handler  - Response: It works
</code></pre>
<p>As you can see, the only log entry is the one from the initial call that wasn't triggered by a Kafka pub/sub. I have verified the trigger exists:</p>
<pre><code>$ kubeless trigger kafka ls
NAME    NAMESPACE   TOPIC       FUNCTION SELECTOR
test    default     test-topic  function=my-handler
</code></pre>
<p>As far as I can tell, Kafka seems to be running (I've also checked the Kafka logs, to no avail):</p>
<pre><code>$ kubectl get pods --namespace=kubeless
NAME                                          READY   STATUS    RESTARTS   AGE
kafka-0                                       1/1     Running   0          170m
kafka-trigger-controller-f6f7c699f-m6mcd      1/1     Running   0          170m
kubeless-controller-manager-59d484f4d-9wlhq   3/3     Running   10         4d22h
zoo-0                                         1/1     Running   0          170m
</code></pre>
<p>Why is publishing not triggering the function? Any suggestions are appreciated and I thank you in advance.</p>

<p>I nerded out on this and there's an issue with the Kubeless <a href="https://github.com/kubeless/kafka-trigger" rel="nofollow noreferrer">kafka-trigger</a>. Essentially, I'm getting this log when the message is picked up by the controller and tries to trigger the function:</p>
<pre class="lang-sh prettyprint-override"><code>time=&quot;2020-07-14T22:00:15Z&quot; level=error msg=&quot;Unable to elaborate request: Unable to find the service for function my-handler&quot;
</code></pre>
<p>This means that the controller cannot find the <code>my-handler</code> service to trigger the function. If you see the <a href="https://github.com/kubeless/kafka-trigger/blob/68a3798a36e725fb15c2dac4d4dc56274d075c3b/pkg/utils/event_sender.go#L43" rel="nofollow noreferrer">code</a>, you see that it's a call to the K8s API server. So, my guess is that there's an API version mismatch on the newer K8s versions. My server is <code>v1.18.2</code>. I've created <a href="https://github.com/kubeless/kafka-trigger/issues/30" rel="nofollow noreferrer">this issue</a> to track.</p>
