OT-CONTAINER-KIT / redis

A production optimized redis docker image
https://opstree.github.io
23 stars 51 forks source link

[Feature] : Cluster announce to nodeip #44

Closed shubham-cmyk closed 1 year ago

shubham-cmyk commented 1 year ago

This PR introduces an approach to announce redis cluster on some stable node-ip.

You need to pass env variable NODEPORT=true to use the node-ip on redis instead of default pod-ip is assigned.

You can set the node-ip variable on pods according to node-ip-<your-pod-name>=10.12.12.34

Since the pod names are predictable.

shubham-cmyk commented 1 year ago

@brutalmt

There have been a change now. passing node-ip-<your-pod-name>

as a env variable might not work due to bash limitation of not accepting - so just use _ instead

i.e.

node_ip_redis_leader_pod_0ornode_ip_redis_leader_pod_1

don't care about the hostname given by the sts in the - the script would read that hostname in _ format

Check here for implementation