Skip to content

Conversation

@creydr
Copy link
Member

@creydr creydr commented Oct 10, 2025

Changes

  • 🎁 Adds the possibility to deploy the function as a raw kubernetes deployment instead of a knative service
    • Added some new package in pkg:
      • pkg/deployer: This has the two deployer options (as sub packages). That way it should be "easier" to add additional deployers (e.g. for wasm...) later
      • Similar to the deployer added also packages for the describer, remover and lister, which contains the implementations for the deploy-type (knative & k8s) as sub packages
    • Updated the existing integration tests for the deployer, describer, remover and lister and made them generic, so I could reuse them for the raw deployments too
    • Added a MultiDescriber, MultiRemover and MultiLister which are the defaults in the client setup now. Those check the existing source (service for the function.knative.dev/deploy-type annotation) and then delegate the action (Describe, Remove or List) to the according implementation.
    • Added the deploy-type as a new column in the list command
$ func deploy --registry localhost:50000 --deploy-type raw
Building function image
Still building
🙌 Function built: localhost:50000/go-http-func:latest
Pushing function image to the registry "localhost:50000" using the "" user credentials
🎯 Creating Triggers on the cluster
✅ Function deployed in namespace "default" and exposed at URL: 
   http://go-http-func.default.svc.cluster.local

$ func list                                                       
NAME          NAMESPACE  RUNTIME  DEPLOY-TYPE  URL                                             READY
go-http-func  default             raw          http://go-http-func.default.svc                 True
go-http-ksvc  default             knative      http://go-http-ksvc.default.127.0.0.1.sslip.io  True

$ func describe go-http-func                                      
Function name:
  go-http-func
Function is built in image:
  
Function is deployed in namespace:
  default
Routes:
  http://go-http-func.default.svc
Deploy-Type:
  raw
Labels:
  boson.dev/function: true
  function.knative.dev/name: go-http-func
  function.knative.dev/runtime: go

$ k get ksvc
NAME            URL                                               LATESTCREATED         LATESTREADY           READY   REASON
go-http-ksvc    http://go-http-ksvc.default.127.0.0.1.sslip.io    go-http-ksvc-00001    go-http-ksvc-00001    True    

$ k get ksvc go-http-func # <-- no Knative Service deployment for our function !
Error from server (NotFound): services.serving.knative.dev "go-http-func" not found

$ k get deploy
NAME                             READY   UP-TO-DATE   AVAILABLE   AGE
go-http-func                     1/1     1            1           47s

$  k get svc   
NAME                                    TYPE           CLUSTER-IP      EXTERNAL-IP                                         PORT(S)                                              AGE
go-http-func                            ClusterIP      10.96.173.129   <none>                                              80/TCP                                               62s
...

/kind enhancement

Fixes: #2804

Release Note

Add the possibility to deploy a function as raw kubernetes deployment via the --deploy-type=raw argument

@knative-prow knative-prow bot added kind/enhancement do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 10, 2025
@knative-prow
Copy link

knative-prow bot commented Oct 10, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: creydr
Once this PR has been reviewed and has the lgtm label, please assign dsimansk for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@creydr creydr force-pushed the kubernetes-deployer branch from c0a7e4d to f0fa249 Compare October 10, 2025 08:10
@codecov
Copy link

codecov bot commented Oct 10, 2025

Codecov Report

❌ Patch coverage is 37.70279% with 960 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.54%. Comparing base (c88b45b) to head (5d1d3da).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/deployer/integration_test_helper.go 0.00% 304 Missing ⚠️
pkg/deployer/common.go 26.70% 222 Missing and 14 partials ⚠️
pkg/deployer/knative/deployer.go 61.23% 86 Missing and 40 partials ⚠️
pkg/k8s/wait.go 0.00% 61 Missing ⚠️
pkg/deployer/k8s/deployer.go 70.98% 28 Missing and 19 partials ⚠️
pkg/lister/multi_lister.go 13.15% 33 Missing ⚠️
pkg/describer/k8s/describer.go 45.65% 17 Missing and 8 partials ⚠️
pkg/testing/k8s/testing.go 0.00% 20 Missing ⚠️
pkg/remover/k8s/remover.go 43.47% 9 Missing and 4 partials ⚠️
pkg/k8s/logs.go 80.64% 9 Missing and 3 partials ⚠️
... and 13 more

❗ There is a different number of reports uploaded between BASE (c88b45b) and HEAD (5d1d3da). Click for more details.

HEAD has 4 uploads less than BASE
Flag BASE (c88b45b) HEAD (5d1d3da)
unit-tests 3 0
e2e-tests 2 1
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3075      +/-   ##
==========================================
- Coverage   58.31%   52.54%   -5.77%     
==========================================
  Files         134      146      +12     
  Lines       17377    14801    -2576     
==========================================
- Hits        10133     7777    -2356     
+ Misses       6303     6051     -252     
- Partials      941      973      +32     
Flag Coverage Δ
e2e-tests 31.43% <28.28%> (-7.51%) ⬇️
integration-tests 49.40% <27.83%> (-2.81%) ⬇️
unit-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@creydr creydr force-pushed the kubernetes-deployer branch 2 times, most recently from 8e688bf to d37451e Compare October 10, 2025 11:58
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 20, 2025
@creydr creydr force-pushed the kubernetes-deployer branch from 988a5c4 to cb1d6dc Compare October 20, 2025 08:22
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 20, 2025
@creydr
Copy link
Member Author

creydr commented Oct 20, 2025

Rebased after #3100 was in

@creydr creydr force-pushed the kubernetes-deployer branch 2 times, most recently from eb5f35d to baf0d1a Compare October 24, 2025 07:15
@creydr creydr force-pushed the kubernetes-deployer branch from baf0d1a to 74b9af5 Compare October 24, 2025 07:47
@creydr creydr force-pushed the kubernetes-deployer branch from e3ec44a to 4c1b43b Compare October 24, 2025 09:53
@creydr creydr force-pushed the kubernetes-deployer branch from 4c1b43b to 5d1d3da Compare October 24, 2025 09:53
@creydr creydr changed the title [WIP] Add raw deployment deployer Add raw deployment deployer Oct 24, 2025
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 24, 2025
@creydr
Copy link
Member Author

creydr commented Oct 24, 2025

/cc @lkingland @gauron99 @matzew
Ready for review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kubernetes Deployer

2 participants