Skip to content

Conversation

@creydr
Copy link
Member

@creydr creydr commented Jan 22, 2026

Fixes #3390

Changes

  • 🎁 Add the possibility to deploy a function with a Keda HTTP scaler

Currently only exposes the function cluster internally. Issue to make the externally available is #3391.

/kind enhancement

Flow

flowchart TD
    U(User/other service) -->|accesses| A
    A[Entrypoint - Bridge Service] -->|forwards request| B
    B[Keda HTTP add-on interceptor-proxy] -->|forwards request| C
    B -.->|reads| E
    B -.->|scales| D
    C[App service] -->|forwards request| D
    D[Deployment]
    E{HTTPScaledObject}
Loading

Test procedure:

  1. Build the func-cli with those changes
    make build
  2. Clone a repo with a function
    e.g. cd /tmp & git clone https://github.com/creydr/func-go-hello-world
  3. Make sure you have Keda with the HTTP-add-on installed
    kubectl apply --server-side -f https://github.com/kedacore/keda/releases/download/v2.17.0/keda-2.17.0.yaml
    kubectl apply --server-side -f https://github.com/kedacore/keda/releases/download/v2.17.0/keda-2.17.0-core.yaml
    
    
    kubectl apply --server-side -f https://github.com/kedacore/http-add-on/releases/download/v0.11.1/keda-add-ons-http-0.11.1-crds.yaml
    kubectl apply --server-side -f https://github.com/kedacore/http-add-on/releases/download/v0.11.1/keda-add-ons-http-0.11.1.yaml
    
  4. Deploy the function with the keda deployer:
    <path to built-func-binary> deploy --registry <your registry> --deployer keda
    Building function image
    Still building
    Still building
    Yes, still building
    🙌 Function built: quay.io/creydr/func-go-hello-world/func-go-hello-world:latest
    Pushing function image to the registry "quay.io" using the "creydr" user credentials
    ✅ Function deployed in namespace "default" and exposed at URL: 
       http://func-go-hello-world-interceptor-bridge.default.svc:8080
    
  5. Check for the created resources:
    kubectl get httpscaledobject                            
    NAME                  TARGETWORKLOAD                           TARGETSERVICE            MINREPLICAS   MAXREPLICAS   AGE     ACTIVE
    func-go-hello-world   apps/v1/Deployment/func-go-hello-world   func-go-hello-world:80   0             10            2m48s   True
    
    kubectl get svc
    NAME                                    TYPE           CLUSTER-IP     EXTERNAL-IP                                                  PORT(S)    AGE
    func-go-hello-world                     ClusterIP      10.96.245.62   <none>                                                       80/TCP     3m48s
    func-go-hello-world-interceptor-bridge   ExternalName   <none>         keda-add-ons-http-interceptor-proxy.keda.svc.cluster.local   8080/TCP   3m41s
    
  6. Start a load test and see the pods getting scaled by Keda:
    cat <<-EOF | kubectl apply -f  -                                        
    apiVersion: batch/v1              
    kind: Job     
    metadata:
      name: hey-load-test
    spec:    
      template:                                                     
        spec:  
          containers:                           
          - name: hey 
            image: quay.io/creydr/hey:latest
            args:
              - "-n"     
              - "1000000"
              - "-c"
              - "100"
              - "http://func-go-hello-world-interceptor-bridge:8080"
          restartPolicy: Never
      backoffLimit: 1
    EOF
    
    kubectl get po
    NAME                                   READY   STATUS    RESTARTS   AGE
    func-go-hello-world-6b895b8b59-8x2wz   1/1     Running   0          58s
    func-go-hello-world-6b895b8b59-bhgzd   1/1     Running   0          43s
    func-go-hello-world-6b895b8b59-dg4q9   1/1     Running   0          58s
    func-go-hello-world-6b895b8b59-dgp92   1/1     Running   0          43s
    func-go-hello-world-6b895b8b59-h8pzh   1/1     Running   0          27s
    func-go-hello-world-6b895b8b59-j6zwd   1/1     Running   0          43s
    func-go-hello-world-6b895b8b59-k5rkd   1/1     Running   0          63s
    func-go-hello-world-6b895b8b59-n4582   1/1     Running   0          43s
    func-go-hello-world-6b895b8b59-rh56x   1/1     Running   0          27s
    func-go-hello-world-6b895b8b59-vfxtj   1/1     Running   0          58s
    hey-load-test-t4mwp                    1/1     Running   0          68s
    

Release Note

Add keda deployer

@knative-prow knative-prow bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/enhancement labels Jan 22, 2026
@knative-prow
Copy link

knative-prow bot commented Jan 22, 2026

[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 dprotaso for approval. For more information see the Code Review Process.

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

Details 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 knative-prow bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jan 22, 2026
@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 49.13043% with 234 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.67%. Comparing base (f8dd264) to head (f3f5b87).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
pkg/keda/deployer.go 58.01% 73 Missing and 16 partials ⚠️
pkg/deployer/testing/integration_test_helper.go 0.00% 38 Missing ⚠️
pkg/keda/describer.go 50.00% 28 Missing and 8 partials ⚠️
pkg/keda/lister.go 56.89% 19 Missing and 6 partials ⚠️
pkg/keda/remover.go 32.43% 20 Missing and 5 partials ⚠️
cmd/client.go 30.00% 7 Missing ⚠️
pkg/keda/wait.go 63.63% 3 Missing and 1 partial ⚠️
cmd/deploy.go 66.66% 3 Missing ⚠️
pkg/k8s/deployer.go 50.00% 2 Missing and 1 partial ⚠️
pkg/keda/client.go 50.00% 2 Missing and 1 partial ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3386      +/-   ##
==========================================
- Coverage   54.74%   53.67%   -1.08%     
==========================================
  Files         173      179       +6     
  Lines       20112    20147      +35     
==========================================
- Hits        11011    10814     -197     
- Misses       7992     8210     +218     
- Partials     1109     1123      +14     
Flag Coverage Δ
e2e 37.23% <8.13%> (+14.27%) ⬆️
e2e go ?
e2e node ?
e2e python ?
e2e quarkus ?
e2e rust ?
e2e springboot ?
e2e typescript ?
integration 17.58% <60.56%> (-1.07%) ⬇️
unit macos-14 42.35% <2.53%> (-2.34%) ⬇️
unit macos-latest 42.35% <2.53%> (-2.34%) ⬇️
unit ubuntu-24.04-arm 42.66% <1.95%> (-2.16%) ⬇️
unit ubuntu-latest 43.24% <2.53%> (-2.33%) ⬇️
unit windows-latest 42.37% <2.53%> (-2.34%) ⬇️

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.

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 22, 2026
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 22, 2026
@gauron99
Copy link
Contributor

/test all

@creydr creydr changed the title [WIP] Add Keda Deployer Add Keda Deployer Jan 23, 2026
@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 Jan 23, 2026
Comment on lines +186 to +197
CooldownPeriod: ptr.To(int32(300)),
ScalingMetric: &httpv1alpha1.ScalingMetricSpec{
Rate: &httpv1alpha1.RateMetricSpec{
TargetValue: 100,
Window: metav1.Duration{
Duration: time.Minute,
},
Granularity: metav1.Duration{
Duration: time.Second,
},
},
},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@linkvt do you have any recommendations for those metrics? I mostly took them from the example 🙃

@creydr
Copy link
Member Author

creydr commented Jan 23, 2026

/cc @gauron99 @lkingland @matejvasek

@knative-prow knative-prow bot requested review from gauron99 and lkingland January 23, 2026 11:54
@knative-prow knative-prow bot requested a review from matejvasek January 23, 2026 11:54
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 23, 2026
@knative-prow-robot
Copy link

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.


// Override invalid k8s.io/client-go v1.5.2 requirement from keda http-add-on
// keda uses a replace directive internally, but those don't propagate to dependents
replace k8s.io/client-go => k8s.io/client-go v0.34.3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR to resolve this in the KHA is open and will probably be released next week, just need to fix CI, see kedacore/http-add-on#1424

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

Labels

kind/enhancement needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. 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.

Keda deployer

4 participants