dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

Adjust HELM charts to support replication

Open romange opened this issue 1 year ago • 6 comments

romange avatar Mar 06 '23 08:03 romange

@Pothulapati I am guessing we do not need it, right?

romange avatar Apr 27 '23 05:04 romange

It's confusing. If we don't support replication why do we even have a replicaCount value that allows multiple replicas to exist? 🤔 If we have a way to configure an instance to be a replica during init (i.e through command line flags, environment variables), We can configure *-0 to be master always and other instances to be replica in a static manner and get things working in a normal manner.

If we don't want to do any of that, We can close this issue 👍🏼

Pothulapati avatar Apr 27 '23 05:04 Pothulapati

maybe it's for horizontal scale? just deploying multiple instances of Dragonfly?

romange avatar Apr 27 '23 05:04 romange

Hmm, Valid but we are still providing a single service to access any of that instances part of the horizontal scale which means with default configuration, Users can't be sure on which instance they are landing.

For deploying multiple instances, Users can deploy a helm chart multiple times with different names, namespaces. I don't think anyone would want multiple instances of Dragonfly with the same name, and Service.

I guess, We can leave it for now as it works for the normal case i.e 1 instance and allows users to do something on their own when they want multiple instances (i.e create new services, etc) or manually configure replication.

Pothulapati avatar Apr 27 '23 06:04 Pothulapati

https://github.com/Enapter/charts/blob/master/keydb/templates/secret-utils.yaml#L17

for node in {0..{{ (sub (.Values.nodes | int) 1) }}}; do
      if [ "${host}" != "{{ include "keydb.fullname" . }}-${node}" ]; then
          replicas+=("--replicaof {{ include "keydb.fullname" . }}-${node}.{{ include "keydb.fullname" . }}-headless {{ .Values.port }}")
      fi
done

This is how KeyDB helm chart does. It uses a Multi-Master StatefulSet, so redis clients only have to randomly pick one of them to connect (more precisely, using the k8s Service name like keydb:6379), for example:

Pod keydb-0 will have the args --replicaof keydb-1 --replicaof keydb-2. Pod keydb-1 will have the args --replicaof keydb-0 --replicaof keydb-2. Pod keydb-2 will have the args --replicaof keydb-0 --replicaof keydb-1.

The interesting part is that this KeyDB chart utilized a Fully-Connected Mesh Network, it is great for a small KeyDB cluster, however, I wonder if they can provide an option to use a Ring Network.

image

joeky888 avatar Jun 04 '23 17:06 joeky888

Hey @joeky888 That is interesting to know! Dragonfly does not yet support replica having further replicas, and also a replication from multiple replicas. These have not been previously requested by users too so not a priority right now! But when these features exist, mesh topology seems to be the obvious default with multiple replicas on a helm chart.

Pothulapati avatar Jun 09 '23 08:06 Pothulapati

There are no immediate plans to support this

romange avatar Jan 11 '24 04:01 romange