Sign inSign up

opstree/redis-operator

By opstree

Updated over 5 years ago

A Golang based redis operator which will make/oversee Redis setup on top of the Kubernetes.

Image
0

1.4K

opstree/redis-operator repository overview

CircleCI Go Report Card Docker Repository on Quay Maintainability Apache License

Speculator: Redis Operator

A Golang based redis operator that will make/oversee Redis standalone/cluster mode setup on top of the Kubernetes. It can create a redis cluster setup with best practices on Cloud as well as the Bare-metal environment. Also, it provides an in-built monitoring capability using redis-exporter.

Architecture

Purpose

The purpose of creating this operator was to provide easy and production-grade setup of Redis on Kubernetes. It doesn't care if you have a plain on-prem Kubernetes or cloud-based.

Supported Features

Here the features which are supported by this operator:-

  • Redis cluster/standalone mode setup
  • Inbuilt monitoring with Prometheus exporter
  • Dynamic storage provisioning with PVC template
  • Resources restrictions with k8s requests and limits
  • Password/Password-less setup
  • Node selector and affinity
  • Priority class to manage setup priority
  • SecurityContext to manipulate kernel parameters
Getting Started

If you want to deploy redis-operator from scratch to a local Minikube cluster, begin with the Getting started document. It will guide you through the setup step-by-step.

Example

The configuration of the Redis setup should be described in Redis CRD. You will find all the examples manifests in example folder.

Prerequisites

Redis operator requires a Kubernetes cluster of version >=1.8.0. If you have just started with Operators, it's highly recommended to use the latest version of Kubernetes.

Quickstart

The setup can be done by using the helm. If you want to see more example, please go through the example folder.

But you can simply use the helm chart for installation.

# Deploy the redis-operator
helm upgrade redis-operator ./helm/redis-operator --install --namespace redis-operator

After deployment, verify the installation of the operator

helm test redis-operator --namespace redis-operator

Creating a redis cluster or the standalone setup.

# Create redis cluster setup
helm upgrade redis-cluster ./helm/redis-setup --set redisSetup.setupMode="cluster" \
--set redisSetup.clusterSize=3 \
--install --namespace redis-operator
# Create redis standalone setup
helm upgrade redis ./helm/redis-setup --set redisSetup.setupMode="standalone" \
--install --namespace redis-operator

Other customizable values are present in values.yaml with description.

Monitoring with Prometheus

To monitor redis performance we will be using Prometheus. In any case, extra Prometheus configuration will not be required because we will be using the Prometheus service discovery pattern. For that, we already have set these annotations:-

  annotations:
    redis.opstreelabs.in: "true"
    prometheus.io/scrape: "true"
    prometheus.io/port: "9121"
Development

Please see our DEVELOPMENT.md for details.

Release History

Please see our CHNANGELOG.md for details.

Documentation

Please see our GETTING_STARTED.md for details.

To Do

  • Dynamic Configuration Update
  • Add unit test cases
  • Logging needs to be structured
  • Fix permissions in role and role bindings

Tag summary

Content type

Image

Digest

Size

50.6 MB

Last updated

over 6 years ago

docker pull opstree/redis-operator