func icon indicating copy to clipboard operation
func copied to clipboard

Add raw deployment deployer

Open creydr opened this issue 1 month ago • 5 comments

Changes

  • :gift: Adds the possibility to deploy the function as a raw kubernetes deployment instead of a knative service
    • 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
    • Updated clients WithLister(), WithDescriber(), WithRemover(), to accept a variadic argument list. Then letting the coresponding lister/describer/remover handle the action.
    • Added the deployer as a new column in the list command
$ func deploy --registry localhost:50000 --deployer 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  DEPLOYER     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
Deployer:
  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 --deployer=raw argument

creydr avatar Oct 10 '25 08:10 creydr

Codecov Report

:x: Patch coverage is 38.09812% with 1022 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 59.77%. Comparing base (af45a47) to head (70c7019). :warning: Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/deployer/testing/integration_test_helper.go 0.00% 626 Missing :warning:
pkg/k8s/deployer.go 78.10% 59 Missing and 31 partials :warning:
pkg/remover/testing/integration_test_helper.go 0.00% 58 Missing :warning:
pkg/lister/testing/integration_test_helper.go 0.00% 50 Missing :warning:
cmd/completion_util.go 0.00% 24 Missing :warning:
pkg/testing/k8s/testing.go 0.00% 20 Missing :warning:
pkg/k8s/logs.go 78.20% 14 Missing and 3 partials :warning:
pkg/k8s/remover.go 43.33% 12 Missing and 5 partials :warning:
pkg/knative/describer.go 37.50% 13 Missing and 2 partials :warning:
pkg/k8s/wait.go 77.04% 7 Missing and 7 partials :warning:
... and 11 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3075      +/-   ##
==========================================
- Coverage   62.35%   59.77%   -2.59%     
==========================================
  Files         150      162      +12     
  Lines       13522    14763    +1241     
==========================================
+ Hits         8432     8824     +392     
- Misses       4112     4887     +775     
- Partials      978     1052      +74     
Flag Coverage Δ
e2e-tests 41.50% <46.20%> (+0.72%) :arrow_up:
integration-tests 54.51% <34.22%> (-1.36%) :arrow_down:
unit-tests 45.53% <4.78%> (-3.93%) :arrow_down:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Oct 10 '25 08:10 codecov[bot]

Rebased after #3100 was in

creydr avatar Oct 20 '25 08:10 creydr

/cc @lkingland @gauron99 @matzew Ready for review

creydr avatar Oct 24 '25 10:10 creydr

Rebased to fix merge conflicts

creydr avatar Oct 27 '25 06:10 creydr

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: creydr, lkingland

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

The pull request process is described 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

knative-prow[bot] avatar Nov 13 '25 06:11 knative-prow[bot]

/lgtm

gauron99 avatar Nov 13 '25 09:11 gauron99