Giter Site home page Giter Site logo

redis-cluster-operator's Introduction

Redis Cluster Operator

The Redis Cluster Operator runs Redis Clusters on Kubernetes.

We've found many operators which either use the redis-cli directly, which makes it hard to customise behaviour, or do not support a full productionised suite of features.

The aim for this operator is to run productionised clusters with most necessary features, as well as providing additions such as RunBooks to help debug issues with Redis Clusters when running them with this Operator, and ready-made load tests to test your Redis Clusters with real traffic.

Features this operator supports

  • Cluster Creation
  • Cluster Management
  • Support for replicated clusters (Master-Replica splits)
  • 0 Downtime scaling
  • 0 Downtime upgrades
  • Persistent clusters (Supported through Kubernetes PVC management)
  • Backup & Restore capability for persistent clusters
  • Documentation on observability for clusters
  • Runbooks for common debugging issues and resolutions
  • Ready-made k6s load tests to load Redis Clusters

Installing the Operator

bundled cluster-wide

The operator gets bundled for every release together with all of it's crds, rbac, and deployment.

The origin bundle works in cluster mode, and will manage all RedisClusters created in all namespaces.

To install or upgrade the operator

kubectl apply -f https://github.com/ContainerSolutions/redis-cluster-operator/releases/latest/download/bundle.yml

This will install the Operator in a new namespace redis-cluster-operator.

You can also install the operator in a custom namespace.

bundled namespaced

The operator currently works in cluster-wide mode, but the Operator will support namespaced mode in the future.

We know it's quite important for redundancy, reducing single-point of failures, as well as tenanted models, or excluding namespaces from the operator.

The Operator will support Namespaced mode in the future.

OLM bundle

OLM bundling support is a work in progress. There are remnants of OLM due to the initial Operator SDK installation, but we have not specifically tested and looked at it in depth.

Creating your first Redis Cluster

To create your first Redis cluster, you'll need a CRD.

apiVersion: cache.container-solutions.com/v1alpha1
kind: RedisCluster
metadata:
  name: rediscluster-product-api
spec:
  masters: 3
  replicasPerMaster: 1

Once applied, the Operator will create all the necessary nodes, and set up the cluster ready for use.

Remember to check out the documentation page for more information.

redis-cluster-operator's People

Contributors

chris-cmsoft avatar eminalemdar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

redis-cluster-operator's Issues

Ability to override all pod settings

This would provide a lot of flexibility for all users.

We can default the normal pod spec, and allow overriding most settings and document how to do that.

We can default the redis container, and then allow overriding the redis pod, as well as adding additional containers for things like Prometheus and InfluxDB metrics and whatever else folks need.

Update namespace and operator names to be more friendly to clusters

By default Operator SDK generated controller-manager as both the namespace and names of most resources.

This is quite unfriendly to folks running many operators, and we should probably update these to be more reflective of the actual operator.

An example of this can be seen in config/manager/manager.yaml

Document how to create persistent clusters

Creating persistent clusters is possible through the new podSpec field.

We should probably document how to create Redis Clusters with persistence for those who want to do that.

Trying to failover master without moving slots

When ensuring the master replica ratio, and there are too many masters, we try to fail over the first master we find.

If that master has slots assigned to it, the failover fails and we end up in a reconciliation loop forever.

We should try to order the masters by slot, so that we can select a master without slot for the failover.

When a Redis Pod restarts, redis-cli check stops working

When a Redis pod restarts, the old Node ID is reset to a new node. The new node successfully meets the cluster, and successfully joins the pool. The old Node though, is not forgotten as it should be, especially when running without any persistence.

If all the nodes are running, and the cluster is successfully serving all slots, we should be confident in removing the old node id and forgetting it.

If a master node fails, it is automatically failed over to it's replica. If a replica restarts, the new node successfully joins the previous master node.

Allow injecting a password for Redis Clusters

Most redis clusters will be using a password, and we need to make sure the operator has the capability to use password.

There are a few spots now where we will need the password.

  • Readiness & Liveness Probes
  • Redis node communication (we need to inject into the redis.conf)
  • Redis clients need to use the password

We also need to provide this capability by providing a secret with interfaced keys.

This allows people using the Operator to inject secrets to Redis cluster however they prefer, whether this is via the External Secrets Operator or normal Kubernetes secret. Their applications can then use that same secret to connect to the Redis Cluster.

Add documentation for how to override Redis settings

It is currently possible to override all of the Redis settings for redis.conf, but this isn't documented anywhere.

It's a good idea to document these for users.

Currently you can override Redis configuration by specifying it in the CRD under config:

apiVersion: cache.container-solutions.com/v1alpha1
kind: RedisCluster
metadata:
  name: rediscluster-sample
spec:
  masters: 3
  replicasPerMaster: 1
  config: |
    maxmemory 50mb
    maxmemory-policy allkeys-lru

Allow overriding Pod parameters

When users use the Operator in certain secure contexts such as OpenShift, they may need to update the security context and parameters of the pods externally.

We need to cater for this in the Redis Operator to allow overriding some of these things

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.