Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Is possible use serverless-kubeless with java ? #153

Open
klebermagno opened this issue Oct 2, 2018 · 1 comment
Open

Is possible use serverless-kubeless with java ? #153

klebermagno opened this issue Oct 2, 2018 · 1 comment

Comments

@klebermagno
Copy link

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 ?

@andresmgot
Copy link
Contributor

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants