Skip to content
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

Extend RabbitMQ scaler to support HTTM management API protocol #123

Merged
merged 2 commits into from
Apr 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions content/scalers/rabbitmq-queue.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,25 @@ triggers:
host: RabbitMqHost
queueLength: '20' # Optional. Queue length target for HPA. Default: 20 messages
queueName: testqueue
includeUnacked: 'true' # Optional, use unacked + ready messages count
apiHost: RabbitApiHost # Optional HTTP managemet API endpoint
```

The `host` value is the name of the environment variable your deployment uses to get the connection string. This is usually resolved from a `Secret V1` or a `ConfigMap V1` collections. `env` and `envFrom` are both supported. The resolved host should follow a format like `amqp://guest:password@localhost:5672/vhost`

`apiHost` has the similar format but for HTTP API endpoint, like `https://guest:password@localhost:443/vhostname`. Note it has optional vhost name after the host slash which will be used to scope API request.

By default `includeUnacked` is `false` in this case scaler uses AMQP protocol, requires `host` and only counts messages in the queue and ignores unacked messages.
If `includeUnacked` is `true` then `host` is not required but `apiHost` is required in this case scaler uses HTTP management API and counts messages in the queue + unacked messages count.

### Authentication Parameters

Not supported yet.

### Example

AMQP protocol:

```yaml
apiVersion: keda.k8s.io/v1alpha1
kind: ScaledObject
Expand All @@ -45,3 +54,24 @@ spec:
queueName: testqueue
queueLength: "20"
```

HTTP protocol:

```yaml
apiVersion: keda.k8s.io/v1alpha1
kind: ScaledObject
metadata:
name: rabbitmq-scaledobject
namespace: default
spec:
scaleTargetRef:
deploymentName: rabbitmq-deployment
triggers:
- type: rabbitmq
metadata:
includeUnacked: "true"
# Required
apiHost: RabbitApiHost # references a value of format https://guest:password@localhost:443/vhostname
queueName: testqueue
queueLength: "20"
```