Skip to content

Commit 06637d5

Browse files
committed
Add Redis Sentinel configuration details to pubsub component documentation
Signed-off-by: MyMirelHub <15373565+MyMirelHub@users.noreply.github.com>
1 parent dd3e9e2 commit 06637d5

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

daprdocs/content/en/reference/components-reference/supported-pubsub/setup-redis-pubsub.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The above example uses secrets as plain strings. It is recommended to use a secr
4040
4141
| Field | Required | Details | Example |
4242
|--------------------|:--------:|---------|---------|
43-
| redisHost | Y | Connection-string for the redis host. If `"redisType"` is `"cluster"` it can be multiple hosts separated by commas or just a single host | `localhost:6379`, `redis-master.default.svc.cluster.local:6379`
43+
| redisHost | Y | Connection-string for the redis host. If `"redisType"` is `"cluster"`, it can be multiple hosts separated by commas. When using Redis Sentinel multiple sentinel addresses can also be provided as comma-separated values. | `localhost:6379`, `redis-master.default.svc.cluster.local:6379`
4444
| redisPassword | N | Password for Redis host. No Default. Can be `secretKeyRef` to use a secret reference | `""`, `"KeFg23!"`
4545
| redisUsername | N | Username for Redis host. Defaults to empty. Make sure your redis server version is 6 or above, and have created acl rule correctly. | `""`, `"default"`
4646
| consumerID | N | The consumer group ID. | Can be set to string value (such as `"channel1"` in the example above) or string format value (such as `"{podName}"`, etc.). [See all of template tags you can use in your component metadata.]({{% ref "component-schema.md#templated-metadata-values" %}})
@@ -101,6 +101,26 @@ You can use [Helm](https://helm.sh/) to quickly create a Redis instance in our K
101101
- name: redisHost
102102
value: redis-master:6379
103103
```
104+
## Redis Sentinel configuration
105+
106+
When using Redis Sentinel for high availability, enable failover mode and provide the sentinel master name. Multiple sentinel addresses can be specified as a comma-separated list in the `redisHost` field for redundancy.
107+
108+
```yaml
109+
apiVersion: dapr.io/v1alpha1
110+
kind: Component
111+
metadata:
112+
name: redis-pubsub
113+
spec:
114+
type: pubsub.redis
115+
version: v1
116+
metadata:
117+
- name: redisHost
118+
value: "sentinel1:26379,sentinel2:26379,sentinel3:26379"
119+
- name: failover
120+
value: "true"
121+
- name: sentinelMasterName
122+
value: "mymaster"
123+
```
104124

105125
4. Next, we'll get our Redis password, which is slightly different depending on the OS we're using:
106126
- **Windows**: Run `kubectl get secret --namespace default redis -o jsonpath="{.data.redis-password}" > encoded.b64`, which will create a file with your encoded password. Next, run `certutil -decode encoded.b64 password.txt`, which will put your redis password in a text file called `password.txt`. Copy the password and delete the two files.

0 commit comments

Comments
 (0)