Add-on for KEDA to scale HTTP workloads
Go to file
Aaron Schlesinger c211da9bd1
Multi-tenant interceptor and scaler (#206)
* multi-tenant interceptor and scaler

Signed-off-by: Aaron Schlesinger <aaron@ecomaz.net>

* specifying host in XKCD ingress

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* routing the xkcd chart to the interceptor properly

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* check host header first

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* sending true active response in stream

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* passing target pending requests through to the underlying ScaledObject (so the scaler can read it later)

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* removing broken target pending requests

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* using getHost in proxy handler

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* adding integration test

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* adding more tests to the integration test

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* splitting up integration tests

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* more checks

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* mark new test TODO

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* expanding interceptor integration tests

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* error messages

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* refactor test

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* more test improvements

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* rolling back target pending requests in ScaledObject

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* removing target metric error. it's not used anymore

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* improving waitFunc test

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* Refactoring the deployment cache to add better error handing and resilience.

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* adding doc comment

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* refactoring deploy cache and adding tests

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* Using interfaces for deployment watch & list

this makes tests easier

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* adding more deploy cache tests

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* Fixing up TestK8sDeploymentCacheRewatch

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* shutting down everything else when one thing errors, and adding a deployments cache endpoint

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* removing commented code

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* clarifying deployment cache JSON output, and simplifying deployment watch function

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* adding TODO tests

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* error logs and restoring the count middleware

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* using consistent net/http package name throughout main.go

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* Refactoring deployment cache deployment storage

Also, running go mod tidy and adding new TODO (i.e. failing) tests

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* using deployment.Status.ReadyReplicas, instead of just replicas

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* integration_tets ==> proxy_handlers_integration_test

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* adding some resilience to tests

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* adding deployment cache endpoint documentation

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* running the global test target with sh.RunV

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* adding timeout to magefile test target

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>

* finishing one TODO test and adding issue for the rest:

Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>
2021-09-03 10:19:20 +02:00
.github setting proper tag version in release script (#198) 2021-06-24 08:02:57 -07:00
cli Starting to move components from prototype repo (#2) 2021-01-27 11:41:52 -08:00
docs Multi-tenant interceptor and scaler (#206) 2021-09-03 10:19:20 +02:00
e2e Multi-tenant interceptor and scaler (#206) 2021-09-03 10:19:20 +02:00
examples Multi-tenant interceptor and scaler (#206) 2021-09-03 10:19:20 +02:00
interceptor Multi-tenant interceptor and scaler (#206) 2021-09-03 10:19:20 +02:00
operator Multi-tenant interceptor and scaler (#206) 2021-09-03 10:19:20 +02:00
pkg Multi-tenant interceptor and scaler (#206) 2021-09-03 10:19:20 +02:00
proto Fixing app creation timing issue (#116) 2021-05-18 18:55:47 +00:00
scaler Multi-tenant interceptor and scaler (#206) 2021-09-03 10:19:20 +02:00
.dockerignore Multi-tenant interceptor and scaler (#206) 2021-09-03 10:19:20 +02:00
.gitignore Starting to move components from prototype repo (#2) 2021-01-27 11:41:52 -08:00
LICENSE Initial commit 2020-11-25 19:53:29 +01:00
README.md chore: KEDA was accepted as CNCF Incubation project (#229) 2021-08-18 21:25:24 +02:00
RELEASE-PROCESS.md adding release process document (#211) 2021-07-20 09:37:26 +02:00
go.mod Multi-tenant interceptor and scaler (#206) 2021-09-03 10:19:20 +02:00
go.sum Multi-tenant interceptor and scaler (#206) 2021-09-03 10:19:20 +02:00
magefile.go Multi-tenant interceptor and scaler (#206) 2021-09-03 10:19:20 +02:00

README.md

Kubernetes-based Event Driven Autoscaling - HTTP Add-On

The KEDA HTTP Add On allows Kubernetes users to automatically scale their HTTP servers up and down (including to/from zero) based on incoming HTTP traffic. Please see our use cases document to learn more about how and why you would use this project.

🚧 Project status: beta 🚧
⚠ The HTTP add-on currently is in beta. We can't yet recommend it for production usage because we are still developing and testing it. It may have "rough edges" including missing documentation, bugs and other issues. It is currently provided as-is without support.

HTTP Autoscaling Made Simple

KEDA provides a reliable and well tested solution to scaling your workloads based on external events. The project supports a wide variety of scalers - sources of these events, in other words. These scalers are systems that produce precisely measurable events via an API.

KEDA does not, however, include an HTTP-based scaler out of the box for several reasons:

  • The concept of an HTTP "event" is not well defined.
  • There's no out-of-the-box single system that can provide an API to measure the current number of incoming HTTP events or requests.
  • The infrastructure required to achieve these measurements is more complex and, in some cases, needs to be integrated into the HTTP routing system in the cluster (e.g. the ingress controller).

For these reasons, the KEDA core project has purposely not built generic HTTP-based scaling into the core.

This project, often called KEDA-HTTP, exists to provide that scaling. It is composed of simple, isolated components and includes an opinionated way to put them together.

Walkthrough

Although this is currently a beta release project, we have prepared a walkthrough document that with instructions on getting started for basic usage.

See that document at docs/walkthrough.md

Design

The HTTP add-on is composed of multiple mostly independent components. This design was chosen to allow for highly customizable installations while allowing us to ship reasonable defaults.

  • We have written a complete design document. Please see it at docs/design.md.
  • For more context on the design, please see our scope document.
  • If you have further questions about the project, please see our FAQ document.

Installation

Please see the complete installation instructions.

Contributing

This project follows the KEDA contributing guidelines, which are outlined in CONTRIBUTING.md.

If you would like to contribute code to this project, please see docs/developing.md.


We are a Cloud Native Computing Foundation (CNCF) incubation project.

Code of Conduct

Please refer to the organization-wide Code of Conduct document.