-
Notifications
You must be signed in to change notification settings - Fork 480
docs: Temporal scaler #1207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
docs: Temporal scaler #1207
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8cd61d7
Add docs for temporal scaler
prajithp13 d0cded1
update version
prajithp13 23b245b
Merge branch 'main' into temporal_scaler
Prajithp 5fbd197
update doc with latest changes
prajithp13 8b7b0c2
Update content/docs/2.17/scalers/temporal.md
Prajithp 7c96350
Update content/docs/2.17/scalers/temporal.md
Prajithp 8d30bf4
update doc
prajithp13 0230ba9
Merge branch 'main' into temporal_scaler
Prajithp 1612744
update doc
prajithp13 c454568
Update content/docs/2.17/scalers/temporal.md
zroubalik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,115 @@ | ||
+++ | ||
title = "Temporal" | ||
availability = "v2.17+" | ||
maintainer = "Community" | ||
description = "Scale applications based on Temporal task queue." | ||
go_file = "temporal_scaler" | ||
+++ | ||
|
||
### Trigger Specification | ||
|
||
This specification describes the `temporal` trigger that scales based on a temporal task queue. | ||
|
||
```yaml | ||
triggers: | ||
- type: temporal | ||
metadata: | ||
Prajithp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
namespace: default | ||
taskQueue: "workflow_with_single_noop_activity:test" | ||
targetQueueSize: "2" | ||
activationTargetQueueSize: "0" | ||
endpoint: temporal-frontend.temporal.svc.cluster.local:7233 | ||
queueTypes: workflow # optional | ||
buildId: 1.0.0 # optional | ||
selectAllActive: false # optional | ||
selectUnversioned: false optional | ||
minConnectTimeout: 5 # optional | ||
unsafeSsl: false # optional | ||
``` | ||
|
||
**Parameter list:** | ||
|
||
- `endpoint` - This parameter specifies the URL of the Temporal gRPC service. You need to provide the service address in the format `<hostname>:<port>`. (Required) | ||
- `endpointFromEnv` - Defines the endpoint, similar to the `endpoint` parameter, but the value is read from an environment variable. (Optional) | ||
- `namespace` - The namespace of the temporal service. (Default:`default`, Optional) | ||
- `activationTargetQueueSize` - This sets the target value for activating the scaler. More information about activation thresholds can be found [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds). (Default: `0`, Optional) | ||
- `targetQueueSize` - Target value for queue length passed to the scaler. The scaler will cause the replicas to increase if the queue message count is greater than the target value per active replica. (Default: `5`, Optional) | ||
- `taskQueue` - This parameter specifies the task queue name. (Required) | ||
- `queueTypes` - Task Queue type can be set to either workflow, activity, or both. By default, the type is set to `workflow`. This field is optional. | ||
Prajithp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- `buildId` - Build IDs identify Worker versions for Workflow versioning and task compatibility (Optional) | ||
- `selectAllActive` - Include all active versions (Default:`false`, Optional) | ||
- `selectUnversioned` - Include the unversioned queue (Default:`false`, Optional) | ||
- `apiKey` - API key for authentication with temporal cloud (Optional) | ||
- `apiKeyFromEnv` - API key for authentication similar to `apiKey`, but read from an environment variable (Optional) | ||
- `minConnectTimeout` - This is the minimum amount of time we are willing to give a connection to complete. (Default:`5`, Optional) | ||
- `unsafeSsl` - Whether to allow unsafe SSL (Default: `false`, Optional) | ||
|
||
> 💡 **NOTE:** Activation based on backlog may not be reliable when scaling to zero. | ||
This approach fails to account for in-flight tasks or workloads with throughput too low to trigger a backlog. | ||
Consequently, scaling to zero could result in undesirable behavior, | ||
such as terminating resources and subsequently having to scale back up to handle queued tasks. To address these challenges, consider customizing the cooldownPeriod or scale-down behavior of the Horizontal Pod Autoscaler (HPA). | ||
By fine-tuning the configurations, you can prevent premature scaling to zero, | ||
ensuring that resources remain available for in-flight tasks or workloads with minimal throughput. | ||
|
||
|
||
**Authentication Parameters:** | ||
|
||
Temporal supports `apiKey` and `mTLS` for authentication. You can use the following parameters to configure authentication: | ||
|
||
- `apiKey` - API key for authentication with temporal cloud. (Optional) | ||
- `ca` - Certificate authority file for TLS client authentication. (Optional) | ||
- `cert` - Certificate for client authentication. (Optional) | ||
- `key` - Key for client authentication. (Optional) | ||
- `keyPassword` - If set the keyPassword is used to decrypt the provided key. (Optional) | ||
|
||
### Example | ||
|
||
```yaml | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: temporal-secret | ||
namespace: default | ||
type: Opaque | ||
data: | ||
apiKey: TlJBSy0xMjM0NTY3ODkwMTIzNDU2Nwo= # base64 encoding of the new relic api key NRAK-12345678901234567 | ||
--- | ||
apiVersion: keda.sh/v1alpha1 | ||
kind: TriggerAuthentication | ||
metadata: | ||
name: keda-trigger-auth-temporal | ||
namespace: default | ||
spec: | ||
secretTargetRef: | ||
- parameter: apiKey | ||
name: temporal-secret | ||
key: apiKey | ||
--- | ||
apiVersion: keda.sh/v1alpha1 | ||
kind: ScaledObject | ||
metadata: | ||
name: workload-scaledobject | ||
namespace: default | ||
spec: | ||
scaleTargetRef: | ||
name: workload-scaledobject | ||
pollingInterval: 5 | ||
cooldownPeriod: 10 | ||
minReplicaCount: 0 | ||
maxReplicaCount: 5 | ||
advanced: | ||
horizontalPodAutoscalerConfig: | ||
behavior: | ||
scaleDown: | ||
stabilizationWindowSeconds: 10 | ||
triggers: | ||
- type: temporal | ||
metadata: | ||
namespace: default | ||
taskQueue: "workflow_with_single_noop_activity:test" | ||
targetQueueSize: "2" | ||
activationTargetQueueSize: "0" | ||
endpoint: temporal-frontend.temporal.svc.cluster.local:7233 | ||
authenticationRef: | ||
name: keda-trigger-auth-temporal | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.