Hi all
I can't get my Redis client configured correctly using the
bitnami Redis helm chart. I've configured the helm chart to use the sentinel (`cluster.enabled=true`, `sentinel.enabled=true`).
The bitnami chart exposes two services:
kubectl get svc,endpoints -o wide
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
service/redis ClusterIP 10.20.5.73 6379/TCP,26379/TCP 2m42s app=redis,release=redis
service/redis-headless ClusterIP None 6379/TCP,26379/TCP 2m42s app=redis,release=redis
service/redis-metrics ClusterIP 10.20.4.149 9121/TCP 2m42s app=redis,release=redis
NAME ENDPOINTS AGE
endpoints/redis 10.16.1.46:26379,10.16.2.88:26379,10.16.4.76:26379 + 5 more... 2m42s
endpoints/redis-headless 10.16.1.46:26379,10.16.2.88:26379,10.16.4.76:26379 + 5 more... 2m42s
endpoints/redis-metrics 10.16.1.46:9121,10.16.2.88:9121,10.16.4.76:9121 + 1 more... 2m42s
I'm trying to define a client that I can use to write data, and one that can be used read-only for the slave nodes.
This one for instance gives me read-only errors when I try to set values.
RedisURI redisUri = RedisURI.Builder
.sentinel("redis")
.redis("redis")
.withPassword(redisPassword)
.build();
RedisClient redisClient = RedisClient.create(redisUri);
RedisCommands<String, String> commands = redisClient.connect().sync();
So what would be the correct initializations for a read-only RedisCommands instance, and for a read-write?
Thanks