Skip to content

Commit

Permalink
docs: rabbitmq provide separate paremeters for user and password (ked…
Browse files Browse the repository at this point in the history
…acore#1472)

Signed-off-by: wangrushen <[email protected]>
  • Loading branch information
dovics authored Oct 21, 2024
1 parent ddccbf7 commit 481d5aa
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions content/docs/2.16/scalers/rabbitmq-queue.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ triggers:
# Alternatively, you can use existing environment variables to read configuration from:
# See details in "Parameter list" section
hostFromEnv: RABBITMQ_HOST # Optional. You can use this instead of `host` parameter
usernameFromEnv: RABBITMQ_USERNAME # Optional. You can use this instead of TriggerAuthentication
passwordFromEnv: RABBITMQ_PASSWORD # Optional. You can use this instead of TriggerAuthentication
unsafeSsl: true
```
Expand All @@ -48,6 +50,8 @@ triggers:
Some parameters could be provided using environmental variables, instead of setting them directly in metadata. Here is a list of parameters you can use to retrieve values from environment variables:

- `hostFromEnv` - The host and port of the RabbitMQ server, similar to `host`, but reads it from an environment variable on the scale target.
- `usernameFromEnv` - The username to use to connect to the broker's management endpoint.
- `passwordFromEnv` - The password to use to connect to the broker's management endpoint.

> 💡 **Note:** `host`/`hostFromEnv` has an optional vhost name after the host slash which will be used to scope API request.

Expand All @@ -70,6 +74,15 @@ TriggerAuthentication CRD is used to connect and authenticate to RabbitMQ:

> See the [RabbitMQ Ports](https://www.rabbitmq.com/networking.html#ports) section for more details on how to configure the ports.

**Username and Password based authentication:**

This allows sensitive credentials to be stored and managed separately from the connection string.

- `username` - The username to use to connect to the broker's management endpoint.
- `password` - The password to use to connect to the broker's management endpoint.

> 💡 **Note:** If username or password are set in TriggerAuthentication or environment variables, they will override any credentials provided in the host.

**TLS authentication:**

- `tls` - To enable SSL auth for RabbitMQ, set this to `enable`. If not set, TLS for RabbitMQ is not used. (Values: `enable`, `disable`, Default: `disable`, Optional)
Expand Down Expand Up @@ -125,6 +138,54 @@ spec:
name: keda-trigger-auth-rabbitmq-conn
```

#### AMQP protocol with user/password auth:

```yaml
apiVersion: v1
kind: Secret
metadata:
name: keda-rabbitmq-secret
data:
host: <AMQP URI connection string> # base64 encoded value of format amqp://localhost:5672/vhost (no username/password)
username: <username> # base64 encoded value of username
password: <password> # base64 encoded value of password
---
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
name: keda-trigger-auth-rabbitmq-conn
namespace: default
spec:
secretTargetRef:
- parameter: host
name: keda-rabbitmq-secret
key: host
- parameter: username
name: keda-rabbitmq-secret
key: username
- parameter: password
name: keda-rabbitmq-secret
key: password
---
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: rabbitmq-scaledobject
namespace: default
spec:
scaleTargetRef:
name: rabbitmq-deployment
triggers:
- type: rabbitmq
metadata:
protocol: amqp
queueName: testqueue
mode: QueueLength
value: "20"
authenticationRef:
name: keda-trigger-auth-rabbitmq-conn
```

#### AMQPS protocol with TLS auth:

```yaml
Expand Down

0 comments on commit 481d5aa

Please sign in to comment.