Is there anyway we can migrate Redis Cluster data that are running inside 2 different Kubernetes cluster? How we can communicate between Redis stateful pods which are running on two different Kubernetes Clusters?
We have two Redis Clusters which are running on two different Kubernetes Clusters X & Y. I want to transfer data from redis-X to redis-Y cluster. How we can establish connection between redis-X and redis-Y clusters so that we can migrate data?
Any help or hint is appreciated.
2
Answers
There are two possible approaches to establish connection between clusters:
Built-in solutions
NodePort
– Exposes the service on each Node’s IP at a static port (theNodePort
). AClusterIP
service, to which theNodePort
service routes, is automatically created. You’ll be able to contact theNodePort
service, from outside the cluster, by requesting<NodeIP>
:<NodePort>
LoadBalancer
– Exposes the Service externally using a cloud provider’s load balancer.NodePort
andClusterIP
services, to which the external load balancer routes, are automatically created.ingress
(both 1st and 3rd party implementations) – more flexible then previous two, but only works with HTTP/HTTPS.Read more: Kubernets services, NGINX ingress
3rd party solution
Istio supports multi-cluster deployment model. However, if you don’t have service mesh deployed, doing so may be too much for single task use.
Once you have connection established between clusters you can migrate Redis using
MIGRATE
command, orredis-migrate-tool
proposed in comments.Here is a new approach using Skupper.
https://github.com/bryonbaker/rhai-redis-demo
It is a full step by step demo I wrote that shows a globally distributed real-time replicated cache from on-premises and across four kubernetes clusters. The Redis cache is replicated from on-premises to Sydney, London and and New York.
No NodePorts, Submariner, or Istio Federation required. It all uses standard routes.
The demo is based on OpenShift – but it will work with any flavour of xKS.