serverless-knative icon indicating copy to clipboard operation
serverless-knative copied to clipboard

Buildpacks as function handler

Open darthkali opened this issue 1 year ago • 0 comments

Goal: I'm attempting to support multiple functions, primarily Spring Boot applications, within a single repository. The goal is to be able to share common code like domain classes and define dependencies only once, with the aim to deploy each of these functions individually into a Kubernetes cluster.

Current Approach: Presently, I have divided the functions into separate modules, each with a central pom.xml and a unique pom.xml for each module. I am now capable of building every function (where each module represents one function) using Cloud Native Buildpacks with the following directory structure:

├── module-core
│   ├── src
│   │   ├── ...
│   ├── pom.xml
├── module-func-1
│   ├── src
│   │   ├── ...
│   │   |   ├── Application.java
│   ├── pom.xml
├── module-func-1
│   ├── src
│   │   ├── ...
│   │   |   ├── Application.java
│   ├── pom.xml
├── pom.xml

Problem: I attempted to utilize Knative Functions, but it only allows me to specify multiple functions in the func.yaml file. Consequently, I need to adjust the func.yaml every time I want to deploy a new function. I explored alternatives and discovered the Serverless Framework, which I have previously used with AWS. However, it restricts me to using an already deployed image or a Dockerfile.

Question: Is it feasible to utilize Cloud Native Buildpacks as a handler (pack as builder)? If not, would it be a beneficial feature to implement?

I appreciate any insights and guidance on this issue. Best regards Danny

darthkali avatar Jun 14 '23 09:06 darthkali