{"id":19502291,"url":"https://github.com/amadeusitgroup/redis-operator","last_synced_at":"2025-06-15T14:03:03.621Z","repository":{"id":53544745,"uuid":"130027269","full_name":"AmadeusITGroup/Redis-Operator","owner":"AmadeusITGroup","description":"Redis Operator creates/configures/manages Redis clusters atop Kubernetes","archived":false,"fork":false,"pushed_at":"2021-03-25T06:37:30.000Z","size":15122,"stargazers_count":165,"open_issues_count":20,"forks_count":63,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-05-22T14:31:51.305Z","etag":null,"topics":["kubernetes","operator","redis","redis-cluster","redis-operator"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AmadeusITGroup.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-18T08:08:34.000Z","updated_at":"2024-02-26T01:56:31.000Z","dependencies_parsed_at":"2022-09-21T01:42:10.155Z","dependency_job_id":null,"html_url":"https://github.com/AmadeusITGroup/Redis-Operator","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmadeusITGroup%2FRedis-Operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmadeusITGroup%2FRedis-Operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmadeusITGroup%2FRedis-Operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmadeusITGroup%2FRedis-Operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AmadeusITGroup","download_url":"https://codeload.github.com/AmadeusITGroup/Redis-Operator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250912660,"owners_count":21506865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kubernetes","operator","redis","redis-cluster","redis-operator"],"created_at":"2024-11-10T22:15:56.533Z","updated_at":"2025-04-25T23:31:29.749Z","avatar_url":"https://github.com/AmadeusITGroup.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redis-Operator\n\n![logo](docs/imgs/logo.png)\n\n### Build Status\n[![Build Status](https://travis-ci.org/AmadeusITGroup/Redis-Operator.svg?branch=master)](https://travis-ci.org/AmadeusITGroup/Redis-Operator)\n[![Go Report Card](https://goreportcard.com/badge/github.com/amadeusitgroup/redis-operator)](https://goreportcard.com/report/github.com/amadeusitgroup/redis-operator)\n[![codecov](https://codecov.io/gh/amadeusitgroup/redis-operator/branch/master/graph/badge.svg)](https://codecov.io/gh/amadeusitgroup/redis-operator)\n\n\n\n## Project status: alpha\n\nThis is an ongoing project.\n\nThe aim of this project is to ease the deployment and operations of a [Redis-cluster](https://redis.io/topics/cluster-tutorial) in a [kubernetes](https://kubernetes.io/) environment. It started internally at Amadeus in 2016, we initially designed this project to run on [Openshift](https://www.openshift.com/). This is the second version of our Redis-Operator that is based now on Kubernetes CustomResourceDefinition (CRD) for representing the RedisCluster configuration.\n\n## Overview\n\nThe 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 \n\n![Initial state](docs/imgs/overview_1.png)\n\nAt this point you have your redis process running, each node is aware of each other, but only one master prossess all slots.\n\nIn order to configure properly the different redis-servers and setup the redis cluster, we introduce the `Redis-Operator`.\n\nThe `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.\n\nThen reconciliation is constantly done between the state of the cluster and the configuration stored in the `RedisCluster` CR.\n\n### Development\n\nIf you want to take part of the development, you can follow the document: [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## Deployment\n\nyou can found checkt the [docs/cookbook.md](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.\n\n### Deployment environment requirements\n\nAs 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.\n\n| Environment  | Version |\n|--------------|---------|\n| Openshift    | \u003e= 3.7  |\n| Kubernetes   | \u003e= 1.7  |\n\n### Helm deployment\n\nYou can found in the `charts` folder two helm charts:\n\n- `redis-operator`: used to deploy the `redis-operator` into your kubernetes cluster.\n- `redis-cluster`: used to create a \"Redis Cluster\" instance thanks to the `redis-operator`.\n\n#### Instanciate the `redis-operator`:\n\n```console\nhelm install --name op chart/redis-operator\nNAME:   op\nLAST DEPLOYED: Tue Jan  9 23:41:13 2018\nNAMESPACE: default\nSTATUS: DEPLOYED\n\nRESOURCES:\n==\u003e v1beta1/Deployment\nNAME               DESIRED  CURRENT  UP-TO-DATE  AVAILABLE  AGE\nop-redis-operator  1        1        1           0          0s\n```\n\nTODO: document RBAC support.\n\n#### Create your \"Redis-Cluster\"\n\nThanks to the helm chart `chart/redis-cluster` you can create a `RedisCluster` Custom Resource which will be processed by the `redis-operator`.\n\nYou 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`\n\n```console\nhelm install --name mycluster chart/redis-cluster --set numberOfMaster=3 --set replicationFactor=1\n...\n```\n\n\u003e **! 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.\n\n```console\nhelm install --name mycluster chart/redis-cluster --set image.tag=master --set numberOfMaster=3 --set replicationFactor=1\n...\n```\n\n#### Install the kubctl redis-cluster plugin\n\ndocs available [here](docs/kubectl-plugin.md).\n\n### Deployment from source code\n\n#### Build the container images\n\n```console\ncd $GOPATH/src/github.com/amadeusitgroup/redis-operator\nmake container\nCGO_ENABLED=0 GOOS=linux go build -i -installsuffix cgo -ldflags '-w' -o docker/operator/operator ./cmd/operator/main.go\nCGO_ENABLED=0 GOOS=linux go build -i -installsuffix cgo -ldflags '-w' -o docker/redisnode/redisnode ./cmd/redisnode/main.go\n```\n\nyou can define the docker images tag by adding the variable \"VERSION\"\n\n```console\nmake TAG=\u003cYour-TAG\u003e container\n```\n\npublish the docker images in your docker registry\n\n```console\nmake TAG=\u003cYour-TAG\u003e publish\n```\n\nIn addition to the version, you can also specify the docker registry where will be publish the docker images with the variable DOCKER_REGISTRY\n\n```console\nmake DOCKER_REGISTRY=\"mydockerregistry:5000/\" TAG=\u003cYour-TAG\u003e publish\n```\n\n### How to Release the Redis-Operator\n\nThis project is using [goreleaser](https://goreleaser.com/) and an additional script for releasing also the Helm chart.\n\nFor starting the delivery, you need to clone this repository, then:\n\n```console\nzsh hack/release.sh \u003cversion\u003e \u003cremove-git\u003e\n```\n\na concreate example is: ```zsh ./hack/release.sh v1.0.1 upstream```\n\nThis script:\n\n- generates locally the helm chart with the requested version.\n- updates the helm repo index file (```docs/index.yaml```) file with the new release.\n- creates a new changeset with all changes generated by the new release version, then tag this changeset.\n- push changeset and associated tag to the remote git repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famadeusitgroup%2Fredis-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famadeusitgroup%2Fredis-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famadeusitgroup%2Fredis-operator/lists"}