Highly available, redundant Redis-cluster over kubernetes

7/1/2020

The objective is to create a highly available redis cluster using kubernetes for a nodeJS client. I have already created the architecture as below: Created a Kubernetes cluster of Kmaster with 3 nodes (slaves). Then I created statefulsets and persistent volumes (6 - one for each POD). Then created Redis pods 2 on each node (3 Master, 3 replicas of respective master).

I need to understand the role of Redis Sentinel hereafter, how does it manage the monitoring, scaling, HA for the redis-cluster PODs across the nodes. I understand Sentinel should be on each node and doing its job but what should be the right architecture here?

P.S. I have created a local setup for now, but ultimately this goes on Azure so any suggestions w.r.to az is also welcome.

Thanks!

-- naville
azure
high-availability
kubernetes
redis
redis-sentinel

1 Answer

7/24/2020

From an Azure perspective, you have two options and if you are very specific to option two but are looking for the Sentinel architecture piece, there is business continuity and high availability options in both IaaS (Linux VM scale sets) and PaaS services that go beyond the Sentinel component.

  1. Azure Cache for Redis (PaaS) where you choose & deploy your desired service tier (Premium Tier required for HA) and connect your client applications. Please see: Azure Cache for Redis FAQ and Caching Best Practice.
  2. The second option is to deploy a solution (as you have detailed) as an IaaS solution built from Azure VMs. There are a number of Redis Linux VM images to choose from the Azure Marketplace or there is the option to create a Linux VM OS image from your on-premise solution and migrate that to Azure. The Sentinel component is enabled on each server (master, slavea, and slaveb, ...). There are networking and other considerations too. For building a system from scratch, please see: How to Setup Redis Replication (with Cluster-Mode Disabled) in CentOS 8 – Part 1 and How to Setup Redis For High Availability with Sentinel in CentOS 8 – Part 2
-- Mike Ubezzi
Source: StackOverflow