Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easy Cluster mode on kubernetes #741

Open
ecyrbe opened this issue Oct 21, 2024 · 3 comments
Open

Easy Cluster mode on kubernetes #741

ecyrbe opened this issue Oct 21, 2024 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ecyrbe
Copy link

ecyrbe commented Oct 21, 2024

Feature request type

Kubernetes Operator, or easy config file setup for garnet

Is your feature request related to a problem? Please describe

Using cluster mode on kubernetes is impossible without an operator to meet the other nodes in a statefulset.
Indeed, garnet uses the same cluster model as redis where stafulset/service (with clusterIP none) dns naming pattern is unknown at the config level.

Describe the solution you'd like

provide an operator that orchestrates cluster setup, recovery, migration based on a custom CRD that describes the cluster topology :

apiVersion: garnet.microsoft/v1
kind: GarnetCluster
metadata:
  name: garnet-cluster
spec:
  masterCount: 3
  replicasPerMaster: 1
  storage:
    volumeClaimTemplate:
      spec:
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 1Gi
  • Changing masterCount should reshard and migrate data to resized masters
  • changing replicasPerMaster should replicate data

Describe alternatives you've considered

Allow graceful recovery of the cluster when one or many nodes restart using a dns naming pattern (would be nice) using a predefined cluster DNS names lists. Example :
in garnet.conf

{
  "clusterMasterNames": ["garnet-0", "garnet-1", "garnet-3"],
  "clusterReplicaNames" : ["garnet-4", "garnet-5", "garnet-6"]
}
  • clusterReplicaNames vector should have a size that is multiple of clustesMasterNames
  • each cluster know who he is by getting it's hostname as kubernetes would provision it whensetting a statefulset
  • only static setup would be supported (no dynamic resharding, or dynamic replication)

Additional context

No response

@vazois
Copy link
Contributor

vazois commented Oct 23, 2024

I am not an expert on Kubernetes but I see that there are a couple of open-source options for redis operators that should work with Garnet also. Have you tried any of the following?

https://github.com/spotahome/redis-operator
https://github.com/OT-CONTAINER-KIT/redis-operator

@ecyrbe
Copy link
Author

ecyrbe commented Oct 23, 2024

Thanks for the suggestions,

Unfortunately, Redis operators rely on redis specifics (like binaries, docker images, config files, etc),. not just API surface.

So i'm afraid a dedicated operator is kind of mandatory for garnet.

But maybe it's out of scope of garnet project ?

@badrishc
Copy link
Contributor

It is definitely interesting for the project, and we would be thrilled to see something come from the community.

@badrishc badrishc added help wanted Extra attention is needed enhancement New feature or request labels Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants