Skip to content

Commit

Permalink
feat: nsq scaler docs (kedacore#1485)
Browse files Browse the repository at this point in the history
* feat: nsq scaler docs

Signed-off-by: Matt Ulmer <[email protected]>

* fix: add useHttps/unsafeSsl to nsq scaler docs

Signed-off-by: Matt Ulmer <[email protected]>

* fix: change idleReplicaCount -> minReplicaCount

Signed-off-by: Matt Ulmer <[email protected]>

* fix: move nsq docs from 2.16 to 2.17

Signed-off-by: Matt Ulmer <[email protected]>

---------

Signed-off-by: Matt Ulmer <[email protected]>
  • Loading branch information
Ulminator authored Nov 23, 2024
1 parent 73f6a14 commit b423c03
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 5 deletions.
7 changes: 2 additions & 5 deletions .htmltest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ IgnoreAltMissing: true
IgnoreEmptyHref: true
IgnoreInternalURLs:
# Temporal ignores
- /docs/2.15/scalers/beanstalkd/
- /docs/2.16/scalers/nsq/
# Deprecated and removed resources
- /docs/2.15/authentication-providers/azure-ad-pod-identity/
- /docs/2.15/authentication-providers/aws-kiam/

# Renamed pages
- /docs/2.15/operate/events/
- /docs/2.15/faq/
60 changes: 60 additions & 0 deletions content/docs/2.17/scalers/nsq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
+++
title = "NSQ"
availability = "v2.17+"
maintainer = "Community"
category = "Messaging"
description = "Scale applications based on NSQ topic/channel depth."
go_file = "nsq_scaler"
+++

### Trigger Specification

This specification describes the `nsq` trigger that scales based on [NSQ](https://github.com/nsqio/nsq) topic/channel depth.

```yaml
triggers:
- type: nsq
metadata:
nsqLookupdHTTPAddresses: "nsq-nsqlookupd.nsq:4161"
topic: "example_topic"
channel: "example_channel"
depthThreshold: "10"
activationDepthThreshold: "0"
useHttps: "false"
unsafeSsl: "false"
```
**Parameter list:**
- `nsqLookupdHTTPAddresses` - Comma separated list of [nsqlookupd](https://nsq.io/components/nsqlookupd.html) HTTP addresses in the form `<hostname>:<port>`.
- `topic` - Name of the NSQ datastream that the `channel` relates to.
- `channel` - Name of the channel used to calculate depth.
- `depthThreshold` - Target value for depth to trigger scaling actions. (Default `10`, Optional)
- `activationDepthThreshold` - Target value for depth to activate the scaler. (Default `0`, Optional)
- `useHttps` - Use HTTPS instead of HTTP when communicating with NSQ. (Values: `true`, `false`, Default: `false`, Optional)
- `unsafeSsl` - Skip certificate validation when connecting over HTTPS. (Values: `true`, `false`, Default: `false`, Optional)


> **Notice:**
> - Since ["channels are created on first use by subscribing to the named channel"](https://nsq.io/overview/design.html#simplifying-configuration-and-administration), the topic depth is used instead of the channel depth when the channel does not yet exist on an [nsqd](https://nsq.io/components/nsqd.html) instance. This allows KEDA to effectively bootstrap new channels when the `minReplicaCount` is 0.
> - If the message flow for a channel is paused, KEDA will not scale up consumers of the channel, regardless of the depth.

### Example

```yaml
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: nsq-scaledobject
spec:
scaleTargetRef:
name: nsq-consumer-deployment
triggers:
- type: nsq
metadata:
nsqLookupdHTTPAddresses: "nsq-nsqlookupd.nsq:4161"
topic: "example_topic"
channel: "example_channel"
depthThreshold: "10"
activationDepthThreshold: "0"
```

0 comments on commit b423c03

Please sign in to comment.