serverless-kubeless
serverless-kubeless copied to clipboard
Is possible use serverless-kubeless with java ?
Kubeless work with java. I create a project with Serverless-kubeless with java
service: func
provider:
name: kubeless
runtime: java
plugins:
- serverless-kubeless
functions:
func:
handler: com.example.FunctionApp
this error message:
Serverless: Packaging function: func...
Serverless: Excluding development dependencies...
Serverless: Redeploying func...
Serverless: Unable to find any running pod for func. Retrying...
Serverless: Unable to find any running pod for func. Retrying...
Serverless: Unable to find any running pod for func. Retrying...
Serverless: Unable to find any running pod for func. Retrying...
Serverless: Giving up, unable to retrieve the status of the func deployment.
Is possible use serverless-kubeless with java ?
It should be possible. I see a couple of issues with your serverless.yaml.
First you need to setup the version of java: runtime: java1.8.
Then you need to set the filename and the class name as the handler. For example for the file Foo.java with this content:
▶ cat Foo.java
package io.kubeless;
import io.kubeless.Event;
import io.kubeless.Context;
public class Foo {
public String bar(io.kubeless.Event event, io.kubeless.Context context) {
return "Hello world!";
}
}
You will need to set the handler handler: Foo.bar.