From a94044d4b3bd4c64beaff8a1de6f8d1720a513d3 Mon Sep 17 00:00:00 2001 From: sbarnesthornton <56411235+sbarnesthornton@users.noreply.github.com> Date: Tue, 5 Nov 2024 20:10:56 +0000 Subject: [PATCH] Add beanstalkd scaler docs (#1454) Signed-off-by: Sam Barnes-Thornton Signed-off-by: sbarnesthornton <56411235+sbarnesthornton@users.noreply.github.com> Signed-off-by: Zbynek Roubalik Co-authored-by: Sam Barnes-Thornton Co-authored-by: Jorge Turrado Ferrero Co-authored-by: Zbynek Roubalik --- .htmltest.yml | 2 +- content/docs/2.16/scalers/beanstalkd.md | 83 +++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 content/docs/2.16/scalers/beanstalkd.md diff --git a/.htmltest.yml b/.htmltest.yml index 5e80ea5c2..5e0cbb021 100644 --- a/.htmltest.yml +++ b/.htmltest.yml @@ -5,7 +5,7 @@ IgnoreAltMissing: true IgnoreEmptyHref: true IgnoreInternalURLs: # Temporal ignores - + - /docs/2.15/scalers/beanstalkd/ # Deprecated and removed resources - /docs/2.15/authentication-providers/azure-ad-pod-identity/ - /docs/2.15/authentication-providers/aws-kiam/ diff --git a/content/docs/2.16/scalers/beanstalkd.md b/content/docs/2.16/scalers/beanstalkd.md new file mode 100644 index 000000000..6998b9d0a --- /dev/null +++ b/content/docs/2.16/scalers/beanstalkd.md @@ -0,0 +1,83 @@ ++++ +title = "Beanstalkd" +availability = "v2.16+" +maintainer = "Community" +description = "Scale applications based on beanstalkd queues" +go_file = "beanstalkd_scaler" ++++ + +### Trigger Specification + +This specification describes the `beanstalkd` trigger that scales based on the number of jobs in a Beanstalkd queue. + +```yaml +triggers: + - type: beanstalkd + metadata: + server: beanstalkd.internal-namespace:11300 + includeDelayed: "false" + tube: "default" + activationValue: "10" + value: "15" + timeout: "30" +``` + +**Parameter list:** + +- `server` - Address of beanstalkd server `:`. If no port is specified then the scaler will default to `11300`. +- `includeDelayed` - Whether to include delayed jobs in the count used for scaling. Defaults to false so only `ready` and `reserved` jobs are counted. +- `tube` - Name of the tube to scale on. +- `activationValue` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds). (Default: `0`, Optional, This value can be a float) +- `value` - Number of jobs in the queue to trigger on. Defaults to `ready`+`reserved` jobs if `includeDelayed` isn't set. +- `timeout` - Timeout in seconds for establishing a connection to the beanstalkd server. (Default: `30`, Optional) + +### Authentication Parameters + +No authentication should be needed to connect to the beanstalkd server. + +### Example + +#### Default tube with activation value + +Here the scaler will not be active until there are at least 10 jobs in the tube. Delayed jobs are not included as `includeDelayed` will be set to a default of `false`. + +```yaml +apiVersion: keda.sh/v1alpha1 +kind: ScaledObject +metadata: + name: beanstalkd-scaledobject +spec: + scaleTargetRef: + name: beanstalkd-consumer + maxReplicaCount: 20 + triggers: + - type: beanstalkd + metadata: + server: beanstalkd.internal-namespace:11300 + tube: 'default' + activationValue: "10" + value: "20" +``` + +#### User-created tube with minimum replicas + +A minimum number of replicas is specified here so the scaler will always be active. This means scaling will occur as soon as the job count goes above 5. Delayed jobs are included here. + +```yaml +apiVersion: keda.sh/v1alpha1 +kind: ScaledObject +metadata: + name: beanstalkd-scaledobject +spec: + scaleTargetRef: + name: beanstalkd-consumer + minReplicaCount: 1 + maxReplicaCount: 20 + triggers: + - type: beanstalkd + metadata: + server: beanstalkd.internal-namespace:11300 + tube: 'scaling-tube' + value: "5" + includeDelayed: "true" +```