I am new to Redis and Kubernetes and have a Kubernetes cluster setup of 3 Redis and 3 Sentinel
kubernetes % kubectl -n redis get pods
NAME READY STATUS RESTARTS AGE
redis-0 1/1 Running 0 7d16h
redis-1 1/1 Running 0 7d15h
redis-2 1/1 Running 0 8d
sentinel-0 1/1 Running 0 9d
sentinel-1 1/1 Running 0 9d
sentinel-2 1/1 Running 0 9d
I have successfully connected the sentinel and Redis-master to each other and was able to test basic HA operations using Redis-cli by exec into the pods, now I wanna connect my external java application to this Redis-cluster,
Now best to my understanding we are supposed to connect to Sentinel and Sentinel will guide us Redis-master pod where write operations can be executed.
So I had a few doubts regarding this, Can I connect to any of the sentinel servers and be able to execute my operations or should I always connect to a master? if we are connecting to a sentinel and if the master Sentinel goes down, what should be the plan of action or best practices in this regard, I have read a few blogs but can't seem to reach a clear understanding ?
What should I do to be able to connect my Spring boot to connect to this cluster? I read a bit on this too and it seems I can't connect to a minikube cluster directly from my IntelliJ/local machine and need to create an image and deploy it in a same namespace, is there any workaround for this ?
below is the yaml file for my redis service
apiVersion: v1
kind: Service
metadata:
name: redis
spec:
selector:
name: redis
ports:
- port: 6379
targetPort: 6379
Thanks