• Stars
    star
    165
  • Rank 224,190 (Top 5 %)
  • Language
    Go
  • License
    MIT License
  • Created about 6 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Redis Operator creates/configures/manages Redis clusters atop Kubernetes

Redis-Operator

logo

Build Status

Build Status Go Report Card codecov

Project status: alpha

This is an ongoing project.

The aim of this project is to ease the deployment and operations of a Redis-cluster in a kubernetes environment. It started internally at Amadeus in 2016, we initially designed this project to run on Openshift. This is the second version of our Redis-Operator that is based now on Kubernetes CustomResourceDefinition (CRD) for representing the RedisCluster configuration.

Overview

The Redis-cluster will be deployed thanks to a unique deployment. Each node of the Redis-cluster is running in its own Pod; At startup, each node has no active role (not slave nor master with slot), it just joins the cluster as a master without slot. See representation in the schema below

Initial state

At this point you have your redis process running, each node is aware of each other, but only one master prossess all slots.

In order to configure properly the different redis-servers and setup the redis cluster, we introduce the Redis-Operator.

The redis-operator is watching a new kind of Custom-Resource RedisCluster that stores the redis-cluster configuration: number of masters, and the replication factor (number of slaves by master) and the pod template. Then the redis-operator tries to apply this configuration to the set of redis-server processes. If the number of redis-servers doesn't correspond to the provided configuration, the manager scales the redis-node pods to obtain the proper number of redis-nodes.

Then reconciliation is constantly done between the state of the cluster and the configuration stored in the RedisCluster CR.

Development

If you want to take part of the development, you can follow the document: CONTRIBUTING.md.

Deployment

you can found checkt the docs/cookbook.md that is a step by step commands cookbook to test/demo the deployment of the operator and a redis-cluster with minikube.

Deployment environment requirements

As said, the project was initially designed to works on Openshift, but now support also Kubernetes. Please check the minimum environment version in the table below.

Environment Version
Openshift >= 3.7
Kubernetes >= 1.7

Helm deployment

You can found in the charts folder two helm charts:

  • redis-operator: used to deploy the redis-operator into your kubernetes cluster.
  • redis-cluster: used to create a "Redis Cluster" instance thanks to the redis-operator.

Instanciate the redis-operator:

helm install --name op chart/redis-operator
NAME:   op
LAST DEPLOYED: Tue Jan  9 23:41:13 2018
NAMESPACE: default
STATUS: DEPLOYED

RESOURCES:
==> v1beta1/Deployment
NAME               DESIRED  CURRENT  UP-TO-DATE  AVAILABLE  AGE
op-redis-operator  1        1        1           0          0s

TODO: document RBAC support.

Create your "Redis-Cluster"

Thanks to the helm chart chart/redis-cluster you can create a RedisCluster Custom Resource which will be processed by the redis-operator.

You can configure the Topology of the cluster by providing your own values.yml file to helm, or settings the value with the --set parameters when you execute helm install

helm install --name mycluster chart/redis-cluster --set numberOfMaster=3 --set replicationFactor=1
...

! Warning !, if you want to use the docker images corresponding to the level of code present in the "master" branch. you need to set the image tag when you instanciate the Redis-Cluster chart and the Redis-Operator chart. The "latest" tag is corresponding to the last validated release.

helm install --name mycluster chart/redis-cluster --set image.tag=master --set numberOfMaster=3 --set replicationFactor=1
...

Install the kubctl redis-cluster plugin

docs available here.

Deployment from source code

Build the container images

cd $GOPATH/src/github.com/amadeusitgroup/redis-operator
make container
CGO_ENABLED=0 GOOS=linux go build -i -installsuffix cgo -ldflags '-w' -o docker/operator/operator ./cmd/operator/main.go
CGO_ENABLED=0 GOOS=linux go build -i -installsuffix cgo -ldflags '-w' -o docker/redisnode/redisnode ./cmd/redisnode/main.go

you can define the docker images tag by adding the variable "VERSION"

make TAG=<Your-TAG> container

publish the docker images in your docker registry

make TAG=<Your-TAG> publish

In addition to the version, you can also specify the docker registry where will be publish the docker images with the variable DOCKER_REGISTRY

make DOCKER_REGISTRY="mydockerregistry:5000/" TAG=<Your-TAG> publish

How to Release the Redis-Operator

This project is using goreleaser and an additional script for releasing also the Helm chart.

For starting the delivery, you need to clone this repository, then:

zsh hack/release.sh <version> <remove-git>

a concreate example is: zsh ./hack/release.sh v1.0.1 upstream

This script:

  • generates locally the helm chart with the requested version.
  • updates the helm repo index file (docs/index.yaml) file with the new release.
  • creates a new changeset with all changes generated by the new release version, then tag this changeset.
  • push changeset and associated tag to the remote git repository.

More Repositories

1

GraphDash

A web-based dashboard built on graphs and their metadata.
Python
283
star
2

sonar-stash

Stash (BitBucket) plugin, a pull-request decorator which allows to integrate SonarQube violations directly into your pull-request
Java
165
star
3

Moire-Pattern-Detection

Jupyter Notebook
90
star
4

JumpSSH

Python module to run commands on remote servers through one or more jump servers.
Python
76
star
5

tansu

tansu is a lightweight, push-based state management library. It borrows the ideas and APIs originally designed and implemented by Svelte stores.
TypeScript
68
star
6

HttpSessionReplacer

Store JEE Servlet HttpSessions in Redis
Java
49
star
7

kanary

Go
40
star
8

otter

The Otter project is a highly modular framework whose goal is to provide a common platform to accelerate and facilitate the development of runtime customizable Angular based Web Applications
TypeScript
39
star
9

kubervisor

The Kubervisor allow you to control which pods should receive traffic or not based on anomaly detection.It is a new kind of health check system.
Go
35
star
10

NTP-Proxy

Two programs, which can be used for OS/application leap second immunity verification.
C
27
star
11

cPMML

cPMML is C++ library for scoring machine learning models serialized with the Predictive Model Markup Language (PMML)
C++
25
star
12

workflow-controller

Kubernetes workflow controller
Go
23
star
13

Kubernetes-Kafka-Connect-Operator

A kubernetes operator to deploy and auto-scale KafkaConnect Application.
Go
19
star
14

Assistive-Webdriver

Assistive-Webdriver is a tool to automate end-to-end web application tests with a screen reader.
TypeScript
19
star
15

cpubench1A

cpubench1a is a CPU benchmark program suitable to evaluate the CPU capacity of physical or virtual machines.
Go
15
star
16

amc

Collection of high performance C++ containers that can be chosen as drop-in replacements for std::vector and std::set
C++
13
star
17

protractor-to-playwright

Command line tool that automatically migrates tests from protractor to playwright.
TypeScript
13
star
18

CoreDumper

Clone of https://code.google.com/p/google-coredumper/ with enhancements by Amadeus
C
11
star
19

opsmancombo

Python class for MongoDB Ops Manager and Ansible module
Python
10
star
20

Colors-for-All

Colors-for-all enables you to easily check color contrasts and WCAG compliance (AA or AAA levels as defined by W3C) between specific colors in one shot ! This online application is available for UX/UI designers or any other people involved in digital accessibility.
TypeScript
8
star
21

kassette

kassette is a development server, used mainly for testing, which proxies requests and is able to easily manage local mocks.
TypeScript
8
star
22

unbreakable-branches-jenkins

Java
6
star
23

cloud-cost-allocation

Python
5
star
24

H2O-to-PMML

Java
5
star
25

AutoSSL

Automated SSL certificates monitoring, renewal and deployment from blueprint
Python
5
star
26

ngx-prefetch

Angular builder for prefetching resources before loading the application
TypeScript
5
star
27

Formula

C++
5
star
28

sonar-coverage-evolution

Report decreasing coverage to SonarQube
Java
5
star
29

oscad2

The Open Source Compliance Advisor is the interactive version of the OSLiC for enabling its requestors to use open source software compliantly.
SCSS
5
star
30

ContainerCoreInterceptor

Core_interceptor can be used to handle core dumps in a dockerized environment. It listens on the local docker daemon socket for events. When it receives a die event it checks if the dead container produced any core dump or java heap dump.
Go
5
star
31

asciidoctor-extension-apidoc

AsciidoctorJ inline macro for linking to Javadoc
Java
4
star
32

Accessibility.js

JavaScript
4
star
33

python-memoize

Project based on django-memoize. It is a memoization implementation technique used to cache functions' results with persistent storage in Redis.
Python
4
star
34

Anomaly-Detection-with-Gaussian-Mixtures

Scala
3
star
35

RedisCache

Python function decorator to cache the result in a Redis server.
Python
3
star
36

Time-Series-Library-with-Spark

Scala
3
star
37

xjs

XJS: XML template language for typescript applications
TypeScript
3
star
38

python-jiffybox

API wrapper around the domainFACTORY JiffyBox API
Python
3
star
39

workflow-cps-global-lib-http-plugin

The goal of this plugin is to provide a way to retrieve shared libraries via HTTP(s) when referenced using the @Library declaration in a Jenkinsfile
Java
3
star
40

Confluence-Jira-Macro-customfields-workaround

Java
2
star
41

monitoring-plugins

Set of reusable monitoring plugins for Nagios/Icinga etc.
Perl
2
star
42

Interactive-Video-Player

An interactive video player based on Video.js
TypeScript
2
star
43

eclipse-toml-editor

A project transferred to Eclipse Foundation
Java
2
star
44

Vidocq

A web-based UI to explore MongoDB
TypeScript
2
star
45

python-ptypes

Persistent types: storing objects in memory-mapped files without serializing
Python
2
star
46

mapr-ansible

Python
2
star
47

Postman-Orchestrator

Java
1
star
48

Elastic-Scaling

Scala
1
star
49

pyctlmbatchtoolbox

Set of tools used to interact with Control-M
Python
1
star
50

jenkins-opentracing-plugin

Jenkins OpenTracing Plugin
Java
1
star
51

miniplanes

Go
1
star
52

odyssey-reactive-messaging

Java
1
star
53

collectd-plugins

Set of reusable plugins for collectd
Perl
1
star
54

bdist_pyinstaller

A side-car distutils command to automate creation of the pyinstaller packages in a non-intrusive way
Python
1
star
55

Checkout-Experience-iOS

Amadeus Payment Checkout Experience
Swift
1
star
56

ssh-key-generator

VSCode Extension facilitating the generation and the deployment of SSH keys
TypeScript
1
star
57

Amadeus-MetaConnect-Flight-Preselection

Google Tag Manager tag for flight preselection in Amadeus MetaConnect
Smarty
1
star
58

ivy

typescript template library to build advanced web applications : https://amadeusitgroup.github.io/ivy
TypeScript
1
star
59

keptn-splunk-sli-provider

Keptn-service to integrate Splunk in Keptn as the source for the Service Level Indicators and as a monitoring tool.
Go
1
star