generated from kedacore/github-template
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for any resource which implementes
/scale
subreso…
…urce (#852)
- Loading branch information
Showing
61 changed files
with
1,262 additions
and
644 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# The `HTTPScaledObject` | ||
|
||
>This document reflects the specification of the `HTTPScaledObject` resource for the `v0.7.0` version. | ||
Each `HTTPScaledObject` looks approximately like the below: | ||
|
||
```yaml | ||
kind: HTTPScaledObject | ||
apiVersion: http.keda.sh/v1alpha1 | ||
metadata: | ||
name: xkcd | ||
spec: | ||
hosts: | ||
- myhost.com | ||
pathPrefixes: | ||
- /test | ||
scaleTargetRef: | ||
deployment: xkcd | ||
service: xkcd | ||
port: 8080 | ||
replicas: | ||
min: 5 | ||
max: 10 | ||
|
||
``` | ||
|
||
This document is a narrated reference guide for the `HTTPScaledObject`, and we'll focus on the `spec` field. | ||
|
||
## `hosts` | ||
|
||
These are the hosts to apply this scaling rule to. All incoming requests with one of these values in their `Host` header will be forwarded to the `Service` and port specified in the below `scaleTargetRef`, and that same `scaleTargetRef`'s workload will be scaled accordingly. | ||
|
||
## `pathPrefixes` | ||
|
||
These are the paths to apply this scaling rule to. All incoming requests with one of these values as path prefix will be forwarded to the `Service` and port specified in the below `scaleTargetRef`, and that same `scaleTargetRef`'s workload will be scaled accordingly. | ||
|
||
## `scaleTargetRef` | ||
|
||
This is the primary and most important part of the `spec` because it describes: | ||
|
||
1. The incoming host to apply this scaling rule to. | ||
2. What workload to scale. | ||
3. The service to which to route HTTP traffic. | ||
|
||
### `deployment` | ||
|
||
This is the name of the `Deployment` to scale. It must exist in the same namespace as this `HTTPScaledObject` and shouldn't be managed by any other autoscaling system. This means that there should not be any `ScaledObject` already created for this `Deployment`. The HTTP Add-on will manage a `ScaledObject` internally. | ||
|
||
### `service` | ||
|
||
This is the name of the service to route traffic to. The add-on will create autoscaling and routing components that route to this `Service`. It must exist in the same namespace as this `HTTPScaledObject` and should route to the same `Deployment` as you entered in the `deployment` field. | ||
|
||
### `port` | ||
|
||
This is the port to route to on the service that you specified in the `service` field. It should be exposed on the service and should route to a valid `containerPort` on the `Deployment` you gave in the `deployment` field. | ||
|
||
### `targetPendingRequests` | ||
|
||
>Default: 100 | ||
This is the number of _pending_ (or in-progress) requests that your application needs to have before the HTTP Add-on will scale it. Conversely, if your application has below this number of pending requests, the HTTP add-on will scale it down. | ||
|
||
For example, if you set this field to 100, the HTTP Add-on will scale your app up if it sees that there are 200 in-progress requests. On the other hand, it will scale down if it sees that there are only 20 in-progress requests. Note that it will _never_ scale your app to zero replicas unless there are _no_ requests in-progress. Even if you set this value to a very high number and only have a single in-progress request, your app will still have one replica. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# The `HTTPScaledObject` | ||
|
||
>This document reflects the specification of the `HTTPScaledObject` resource for the `v0.7.0` version. | ||
Each `HTTPScaledObject` looks approximately like the below: | ||
|
||
```yaml | ||
kind: HTTPScaledObject | ||
apiVersion: http.keda.sh/v1alpha1 | ||
metadata: | ||
name: xkcd | ||
spec: | ||
hosts: | ||
- myhost.com | ||
pathPrefixes: | ||
- /test | ||
scaleTargetRef: | ||
name: xkcd | ||
kind: Deployment | ||
apiVersion: apps/v1 | ||
service: xkcd | ||
port: 8080 | ||
replicas: | ||
min: 5 | ||
max: 10 | ||
|
||
``` | ||
|
||
This document is a narrated reference guide for the `HTTPScaledObject`, and we'll focus on the `spec` field. | ||
|
||
## `hosts` | ||
|
||
These are the hosts to apply this scaling rule to. All incoming requests with one of these values in their `Host` header will be forwarded to the `Service` and port specified in the below `scaleTargetRef`, and that same `scaleTargetRef`'s workload will be scaled accordingly. | ||
|
||
## `pathPrefixes` | ||
|
||
These are the paths to apply this scaling rule to. All incoming requests with one of these values as path prefix will be forwarded to the `Service` and port specified in the below `scaleTargetRef`, and that same `scaleTargetRef`'s workload will be scaled accordingly. | ||
|
||
## `scaleTargetRef` | ||
|
||
This is the primary and most important part of the `spec` because it describes: | ||
|
||
1. The incoming host to apply this scaling rule to. | ||
2. What workload to scale. | ||
3. The service to which to route HTTP traffic. | ||
|
||
### `deployment` (DEPRECTATED: removed as part of v0.9.0) | ||
|
||
This is the name of the `Deployment` to scale. It must exist in the same namespace as this `HTTPScaledObject` and shouldn't be managed by any other autoscaling system. This means that there should not be any `ScaledObject` already created for this `Deployment`. The HTTP Add-on will manage a `ScaledObject` internally. | ||
|
||
### `name` | ||
|
||
This is the name of the workload to scale. It must exist in the same namespace as this `HTTPScaledObject` and shouldn't be managed by any other autoscaling system. This means that there should not be any `ScaledObject` already created for this workload. The HTTP Add-on will manage a `ScaledObject` internally. | ||
|
||
### `kind` | ||
|
||
This is the kind of the workload to scale. | ||
|
||
### `apiVersion` | ||
|
||
This is the apiVersion of the workload to scale. | ||
|
||
### `service` | ||
|
||
This is the name of the service to route traffic to. The add-on will create autoscaling and routing components that route to this `Service`. It must exist in the same namespace as this `HTTPScaledObject` and should route to the same `Deployment` as you entered in the `deployment` field. | ||
|
||
### `port` | ||
|
||
This is the port to route to on the service that you specified in the `service` field. It should be exposed on the service and should route to a valid `containerPort` on the `Deployment` you gave in the `deployment` field. | ||
|
||
### `targetPendingRequests` | ||
|
||
>Default: 100 | ||
This is the number of _pending_ (or in-progress) requests that your application needs to have before the HTTP Add-on will scale it. Conversely, if your application has below this number of pending requests, the HTTP add-on will scale it down. | ||
|
||
For example, if you set this field to 100, the HTTP Add-on will scale your app up if it sees that there are 200 in-progress requests. On the other hand, it will scale down if it sees that there are only 20 in-progress requests. Note that it will _never_ scale your app to zero replicas unless there are _no_ requests in-progress. Even if you set this value to a very high number and only have a single in-progress request, your app will still have one replica. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
kind: HTTPScaledObject | ||
apiVersion: http.keda.sh/v1alpha1 | ||
metadata: | ||
name: xkcd | ||
spec: | ||
hosts: | ||
- myhost.com | ||
pathPrefixes: | ||
- /test | ||
scaleTargetRef: | ||
name: xkcd | ||
service: xkcd | ||
port: 8080 | ||
replicas: | ||
min: 5 | ||
max: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
kind: HTTPScaledObject | ||
apiVersion: http.keda.sh/v1alpha1 | ||
metadata: | ||
name: xkcd | ||
spec: | ||
hosts: | ||
- myhost.com | ||
pathPrefixes: | ||
- /test | ||
scaleTargetRef: | ||
name: xkcd | ||
kind: Deployment | ||
apiVersion: apps/v1 | ||
service: xkcd | ||
port: 8080 | ||
replicas: | ||
min: 5 | ||
max: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "xkcd.fullname" . }}-proxy | ||
labels: | ||
{{- include "xkcd.labels" . | nindent 4 }} | ||
spec: | ||
type: ExternalName | ||
externalName: keda-http-add-on-interceptor-proxy.keda |
Oops, something went wrong.