{"id":13644718,"url":"https://github.com/ucloud/redis-cluster-operator","last_synced_at":"2025-04-04T09:07:49.210Z","repository":{"id":36642779,"uuid":"209763352","full_name":"ucloud/redis-cluster-operator","owner":"ucloud","description":"Redis Cluster Operator creates and manages Redis Clusters atop Kubernetes.","archived":false,"fork":false,"pushed_at":"2023-11-02T11:12:35.000Z","size":982,"stargazers_count":371,"open_issues_count":42,"forks_count":138,"subscribers_count":20,"default_branch":"master","last_synced_at":"2024-05-22T14:31:51.645Z","etag":null,"topics":["kubernetes","operator","redis-cluster"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ucloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-20T10:16:07.000Z","updated_at":"2024-06-18T20:05:39.458Z","dependencies_parsed_at":"2024-06-18T20:05:19.300Z","dependency_job_id":"26f5112f-8197-4802-a35c-210e29fe05f9","html_url":"https://github.com/ucloud/redis-cluster-operator","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucloud%2Fredis-cluster-operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucloud%2Fredis-cluster-operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucloud%2Fredis-cluster-operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucloud%2Fredis-cluster-operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ucloud","download_url":"https://codeload.github.com/ucloud/redis-cluster-operator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247149501,"owners_count":20891954,"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-cluster"],"created_at":"2024-08-02T01:02:11.450Z","updated_at":"2025-04-04T09:07:49.184Z","avatar_url":"https://github.com/ucloud.png","language":"Go","readme":"# redis-cluster-operator\n\n## Overview\n\nRedis Cluster Operator manages [Redis Cluster](https://redis.io/topics/cluster-spec) atop Kubernetes.\n\nThe operator itself is built with the [Operator framework](https://github.com/operator-framework/operator-sdk).\n\n![Redis Cluster atop Kubernetes](/static/redis-cluster.png)\n\nEach master node and its slave nodes is managed by a statefulSet, create a headless svc for each statefulSet,\nand create a clusterIP service for all nodes.\n\nEach statefulset uses PodAntiAffinity to ensure that the master and slaves are dispersed on different nodes.\nAt the same time, when the operator selects the master in each statefulset, it preferentially select the pod\nwith different k8s nodes as master.\n\nTable of Contents\n=================\n\n   * [redis-cluster-operator](#redis-cluster-operator)\n      * [Overview](#overview)\n   * [Table of Contents](#table-of-contents)\n      * [Prerequisites](#prerequisites)\n      * [Features](#features)\n      * [Quick Start](#quick-start)\n         * [Deploy redis cluster operator](#deploy-redis-cluster-operator)\n            * [Install Step by step](#install-step-by-step)\n            * [Install using helm chart](#install-using-helm-chart)\n         * [Usage](#usage)\n            * [Deploy a sample Redis Cluster](#deploy-a-sample-redis-cluster)\n            * [Scaling Up the Redis Cluster](#scaling-up-the-redis-cluster)\n            * [Scaling Down the Redis Cluster](#scaling-down-the-redis-cluster)\n            * [Backup and Restore](#backup-and-restore)\n            * [Prometheus Discovery](#prometheus-discovery)\n            * [Create Redis Cluster with password](#create-redis-cluster-with-password)\n            * [Persistent Volume](#persistent-volume)\n            * [Custom Configuration](#custom-configuration)\n            * [Custom Service](#custom-service)\n            * [Custom Resource](#custom-resource)\n      * [ValidatingWebhook](#validatingwebhook)\n      * [End to end tests](#end-to-end-tests)\n\n## Prerequisites\n\n* go version v1.13+.\n* Access to a Kubernetes v1.13.10 cluster.\n\n## Features\n\n- __Customize the number of master nodes and the number of replica nodes per master__\n\n- __Password__\n\n- __Safely Scaling the Redis Cluster__\n\n- __Backup and Restore__\n\n- __Persistent Volume__\n\n- __Custom Configuration__\n\n- __Prometheus Discovery__\n\n## Quick Start\n\n### Deploy redis cluster operator\n\n#### Install Step by step\n\nRegister the DistributedRedisCluster and RedisClusterBackup custom resource definition (CRD).\n```\n$ kubectl create -f deploy/crds/redis.kun_distributedredisclusters_crd.yaml\n$ kubectl create -f deploy/crds/redis.kun_redisclusterbackups_crd.yaml\n```\n\nA namespace-scoped operator watches and manages resources in a single namespace, whereas a cluster-scoped operator watches and manages resources cluster-wide.\nYou can chose run your operator as namespace-scoped or cluster-scoped.\n```\n// cluster-scoped\n$ kubectl create -f deploy/service_account.yaml\n$ kubectl create -f deploy/cluster/cluster_role.yaml\n$ kubectl create -f deploy/cluster/cluster_role_binding.yaml\n$ kubectl create -f deploy/cluster/operator.yaml\n\n// namespace-scoped\n$ kubectl create -f deploy/service_account.yaml\n$ kubectl create -f deploy/namespace/role.yaml\n$ kubectl create -f deploy/namespace/role_binding.yaml\n$ kubectl create -f deploy/namespace/operator.yaml\n```\n\n#### Install using helm chart\n\nAdd Helm repository\n```\nhelm repo add ucloud-operator https://ucloud.github.io/redis-cluster-operator/\nhelm repo update\n```\n\nInstall chart\n```\nhelm install --generate-name ucloud-operator/redis-cluster-operator\n```\n\nVerify that the redis-cluster-operator is up and running:\n```\n$ kubectl get deployment\nNAME                     READY   UP-TO-DATE   AVAILABLE   AGE\nredis-cluster-operator   1/1     1            1           1d\n```\n\n### Usage\n#### Deploy a sample Redis Cluster\n\nNOTE: **Only the redis cluster that use persistent storage(pvc) can recover after accidental deletion or rolling update.Even if you do not use persistence(like rdb or aof), you need to set pvc for redis.**\n\n```\n$ kubectl apply -f deploy/example/redis.kun_v1alpha1_distributedrediscluster_cr.yaml\n```\n\nVerify that the cluster instances and its components are running.\n```\n$ kubectl get distributedrediscluster\nNAME                              MASTERSIZE   STATUS    AGE\nexample-distributedrediscluster   3            Scaling   11s\n\n$ kubectl get all -l redis.kun/name=example-distributedrediscluster\nNAME                                          READY   STATUS    RESTARTS   AGE\npod/drc-example-distributedrediscluster-0-0   1/1     Running   0          2m48s\npod/drc-example-distributedrediscluster-0-1   1/1     Running   0          2m8s\npod/drc-example-distributedrediscluster-1-0   1/1     Running   0          2m48s\npod/drc-example-distributedrediscluster-1-1   1/1     Running   0          2m13s\npod/drc-example-distributedrediscluster-2-0   1/1     Running   0          2m48s\npod/drc-example-distributedrediscluster-2-1   1/1     Running   0          2m15s\n\nNAME                                        TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)              AGE\nservice/example-distributedrediscluster     ClusterIP   172.17.132.71   \u003cnone\u003e        6379/TCP,16379/TCP   2m48s\nservice/example-distributedrediscluster-0   ClusterIP   None            \u003cnone\u003e        6379/TCP,16379/TCP   2m48s\nservice/example-distributedrediscluster-1   ClusterIP   None            \u003cnone\u003e        6379/TCP,16379/TCP   2m48s\nservice/example-distributedrediscluster-2   ClusterIP   None            \u003cnone\u003e        6379/TCP,16379/TCP   2m48s\n\nNAME                                                     READY   AGE\nstatefulset.apps/drc-example-distributedrediscluster-0   2/2     2m48s\nstatefulset.apps/drc-example-distributedrediscluster-1   2/2     2m48s\nstatefulset.apps/drc-example-distributedrediscluster-2   2/2     2m48s\n\n$ kubectl get distributedrediscluster\nNAME                              MASTERSIZE   STATUS    AGE\nexample-distributedrediscluster   3            Healthy   4m\n```\n\n#### Scaling Up the Redis Cluster\n\nIncrease the masterSize to trigger the scaling up.\n\n```\napiVersion: redis.kun/v1alpha1\nkind: DistributedRedisCluster\nmetadata:\n  annotations:\n    # if your operator run as cluster-scoped, add this annotations\n    redis.kun/scope: cluster-scoped\n  name: example-distributedrediscluster\nspec:\n  # Increase the masterSize to trigger the scaling.\n  masterSize: 4\n  ClusterReplicas: 1\n  image: redis:5.0.4-alpine\n```\n\n#### Scaling Down the Redis Cluster\n\nDecrease the masterSize to trigger the scaling down.\n\n```\napiVersion: redis.kun/v1alpha1\nkind: DistributedRedisCluster\nmetadata:\n  annotations:\n    # if your operator run as cluster-scoped, add this annotations\n    redis.kun/scope: cluster-scoped\n  name: example-distributedrediscluster\nspec:\n  # Increase the masterSize to trigger the scaling.\n  masterSize: 3\n  ClusterReplicas: 1\n  image: redis:5.0.4-alpine\n```\n\n#### Backup and Restore\n\nNOTE: **Only Ceph S3 object storage and PVC is supported now**\n\nBackup\n```\n$ kubectl create -f deploy/example/backup-restore/redisclusterbackup_cr.yaml\n```\n\nRestore from backup\n```\n$ kubectl create -f deploy/example/backup-restore/restore.yaml\n```\n\n#### Prometheus Discovery\n\n```\n$ kubectl create -f deploy/example/prometheus-exporter.yaml\n```\n\n#### Create Redis Cluster with password\n\n```\n$ kubectl create -f deploy/example/custom-password.yaml\n```\n\n#### Persistent Volume\n\n```\n$ kubectl create -f deploy/example/persistent.yaml\n```\n\n#### Custom Configuration\n\n```\n$ kubectl create -f deploy/example/custom-config.yaml\n```\n\n#### Custom Service\n\n```\n$ kubectl create -f deploy/example/custom-service.yaml\n```\n\n#### Custom Resource\n\n```\n$ kubectl create -f deploy/example/custom-resources.yaml\n```\n\n## ValidatingWebhook\n\nsee [ValidatingWebhook](/hack/webhook/README.md)\n\n## End to end tests\n\nsee [e2e](/test/e2e/README.md)\n","funding_links":[],"categories":["Repository is obsolete","Go"],"sub_categories":["Awesome Operators in the Wild"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fucloud%2Fredis-cluster-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fucloud%2Fredis-cluster-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fucloud%2Fredis-cluster-operator/lists"}