All Projects → ucloud → Redis Cluster Operator

ucloud / Redis Cluster Operator

Licence: apache-2.0
Redis Cluster Operator creates and manages Redis Clusters atop Kubernetes.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Redis Cluster Operator

Redis Operator
Redis Operator creates/configures/manages Redis clusters atop Kubernetes
Stars: ✭ 142 (-5.33%)
Mutual labels:  redis-cluster, operator
td-redis-operator
一款强大的云原生redis-operator,经过大规模生产级运行考验,支持分布式集群、支持主备切换等缓存集群解决方案…The powerful cloud-native redis-operator, which has passed the test of large-scale production-level operation, supports distributed clusters and active/standby switching ...
Stars: ✭ 327 (+118%)
Mutual labels:  redis-cluster, operator
codis-operator
Codis Operator creates and manages codis clusters(proxy based Redis cluster solution) running in kubernetes.(WIP)
Stars: ✭ 21 (-86%)
Mutual labels:  redis-cluster, operator
Redis Operator
Redis operator build a Highly Available Redis cluster with Sentinel atop Kubernetes
Stars: ✭ 125 (-16.67%)
Mutual labels:  operator
Csredis
.NET Core or .NET Framework 4.0+ client for Redis and Redis Sentinel (2.8) and Cluster. Includes both synchronous and asynchronous clients.
Stars: ✭ 1,714 (+1042.67%)
Mutual labels:  redis-cluster
Alma
ALgoloid with MAcros -- a language with Algol-family syntax where macros take center stage
Stars: ✭ 132 (-12%)
Mutual labels:  operator
Camellia
camellia framework by netease-im. provider: 1) redis-client; 2) redis-proxy(redis-sentinel/redis-cluster); 3) hbase-client; 4) others
Stars: ✭ 146 (-2.67%)
Mutual labels:  redis-cluster
Redis Game Transaction
在大型游戏中经常使用分布式,分布式中因为游戏逻辑会经常游戏事务,借助redis特性我们可以实现分布式锁和分布式事务。很多redis集群不支持redis的事务特性。 这个框架用来解决分布式服务器下redis集群事务失效的情况下,基于分布式锁完成分布式事务。支持独占锁,共享锁,读写锁,并且支持事务提交失败情况下的回滚操作,让开发者可以有更多时间侧重游戏逻辑.
Stars: ✭ 124 (-17.33%)
Mutual labels:  redis-cluster
Redis exporter
Prometheus Exporter for Redis Metrics. Supports Redis 2.x, 3.x, 4.x, 5.x and 6.x
Stars: ✭ 2,092 (+1294.67%)
Mutual labels:  redis-cluster
Overlord
Overlord是哔哩哔哩基于Go语言编写的memcache和redis&cluster的代理及集群管理功能,致力于提供自动化高可用的缓存服务解决方案。
Stars: ✭ 1,884 (+1156%)
Mutual labels:  redis-cluster
Eunomia
A GitOps Operator for Kubernetes
Stars: ✭ 130 (-13.33%)
Mutual labels:  operator
Postgres Operator
Production PostgreSQL for Kubernetes, from high availability Postgres clusters to full-scale database-as-a-service.
Stars: ✭ 2,166 (+1344%)
Mutual labels:  operator
Rubico
[a]synchronous functional programming
Stars: ✭ 133 (-11.33%)
Mutual labels:  operator
Litmus
Litmus helps SREs and developers practice chaos engineering in a Cloud-native way. Chaos experiments are published at the ChaosHub (https://hub.litmuschaos.io). Community notes is at https://hackmd.io/a4Zu_sH4TZGeih-xCimi3Q
Stars: ✭ 2,377 (+1484.67%)
Mutual labels:  operator
E3 Springboot
SpringBoot+Docker重构宜立方商城
Stars: ✭ 139 (-7.33%)
Mutual labels:  redis-cluster
K8up
Kubernetes and OpenShift Backup Operator
Stars: ✭ 130 (-13.33%)
Mutual labels:  operator
Vim Operator Surround
Vim operator mapping to enclose text objects with surrounds like paren, quote and so on.
Stars: ✭ 124 (-17.33%)
Mutual labels:  operator
Harbor Operator
Kubernetes operator for Harbor service components
Stars: ✭ 130 (-13.33%)
Mutual labels:  operator
Helm App Operator Kit
Tool for creating a Kubernetes Operator from a Helm Chart
Stars: ✭ 132 (-12%)
Mutual labels:  operator
Etcd Cloud Operator
Deploying and managing production-grade etcd clusters on cloud providers: failure recovery, disaster recovery, backups and resizing.
Stars: ✭ 149 (-0.67%)
Mutual labels:  operator

redis-cluster-operator

Overview

Redis Cluster Operator manages Redis Cluster atop Kubernetes.

The operator itself is built with the Operator framework.

Redis Cluster atop Kubernetes

Each master node and its slave nodes is managed by a statefulSet, create a headless svc for each statefulSet, and create a clusterIP service for all nodes.

Each statefulset uses PodAntiAffinity to ensure that the master and slaves are dispersed on different nodes. At the same time, when the operator selects the master in each statefulset, it preferentially select the pod with different k8s nodes as master.

Table of Contents

Prerequisites

  • go version v1.13+.
  • Access to a Kubernetes v1.13.10 cluster.

Features

  • Customize the number of master nodes and the number of replica nodes per master

  • Password

  • Safely Scaling the Redis Cluster

  • Backup and Restore

  • Persistent Volume

  • Custom Configuration

  • Prometheus Discovery

Quick Start

Deploy redis cluster operator

Install Step by step

Register the DistributedRedisCluster and RedisClusterBackup custom resource definition (CRD).

$ kubectl create -f deploy/crds/redis.kun_distributedredisclusters_crd.yaml
$ kubectl create -f deploy/crds/redis.kun_redisclusterbackups_crd.yaml

A namespace-scoped operator watches and manages resources in a single namespace, whereas a cluster-scoped operator watches and manages resources cluster-wide. You can chose run your operator as namespace-scoped or cluster-scoped.

// cluster-scoped
$ kubectl create -f deploy/service_account.yaml
$ kubectl create -f deploy/cluster/cluster_role.yaml
$ kubectl create -f deploy/cluster/cluster_role_binding.yaml
$ kubectl create -f deploy/cluster/operator.yaml

// namespace-scoped
$ kubectl create -f deploy/service_account.yaml
$ kubectl create -f deploy/namespace/role.yaml
$ kubectl create -f deploy/namespace/role_binding.yaml
$ kubectl create -f deploy/namespace/operator.yaml

Install using helm chart

Add Helm repository

helm repo add ucloud-operator https://ucloud.github.io/redis-cluster-operator/
helm repo update

Install chart

helm install --generate-name ucloud-operator/redis-cluster-operator

Verify that the redis-cluster-operator is up and running:

$ kubectl get deployment
NAME                     READY   UP-TO-DATE   AVAILABLE   AGE
redis-cluster-operator   1/1     1            1           1d

Usage

Deploy a sample Redis Cluster

NOTE: 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.

$ kubectl apply -f deploy/example/redis.kun_v1alpha1_distributedrediscluster_cr.yaml

Verify that the cluster instances and its components are running.

$ kubectl get distributedrediscluster
NAME                              MASTERSIZE   STATUS    AGE
example-distributedrediscluster   3            Scaling   11s

$ kubectl get all -l redis.kun/name=example-distributedrediscluster
NAME                                          READY   STATUS    RESTARTS   AGE
pod/drc-example-distributedrediscluster-0-0   1/1     Running   0          2m48s
pod/drc-example-distributedrediscluster-0-1   1/1     Running   0          2m8s
pod/drc-example-distributedrediscluster-1-0   1/1     Running   0          2m48s
pod/drc-example-distributedrediscluster-1-1   1/1     Running   0          2m13s
pod/drc-example-distributedrediscluster-2-0   1/1     Running   0          2m48s
pod/drc-example-distributedrediscluster-2-1   1/1     Running   0          2m15s

NAME                                        TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)              AGE
service/example-distributedrediscluster     ClusterIP   172.17.132.71   <none>        6379/TCP,16379/TCP   2m48s
service/example-distributedrediscluster-0   ClusterIP   None            <none>        6379/TCP,16379/TCP   2m48s
service/example-distributedrediscluster-1   ClusterIP   None            <none>        6379/TCP,16379/TCP   2m48s
service/example-distributedrediscluster-2   ClusterIP   None            <none>        6379/TCP,16379/TCP   2m48s

NAME                                                     READY   AGE
statefulset.apps/drc-example-distributedrediscluster-0   2/2     2m48s
statefulset.apps/drc-example-distributedrediscluster-1   2/2     2m48s
statefulset.apps/drc-example-distributedrediscluster-2   2/2     2m48s

$ kubectl get distributedrediscluster
NAME                              MASTERSIZE   STATUS    AGE
example-distributedrediscluster   3            Healthy   4m

Scaling Up the Redis Cluster

Increase the masterSize to trigger the scaling up.

apiVersion: redis.kun/v1alpha1
kind: DistributedRedisCluster
metadata:
  annotations:
    # if your operator run as cluster-scoped, add this annotations
    redis.kun/scope: cluster-scoped
  name: example-distributedrediscluster
spec:
  # Increase the masterSize to trigger the scaling.
  masterSize: 4
  ClusterReplicas: 1
  image: redis:5.0.4-alpine

Scaling Down the Redis Cluster

Decrease the masterSize to trigger the scaling down.

apiVersion: redis.kun/v1alpha1
kind: DistributedRedisCluster
metadata:
  annotations:
    # if your operator run as cluster-scoped, add this annotations
    redis.kun/scope: cluster-scoped
  name: example-distributedrediscluster
spec:
  # Increase the masterSize to trigger the scaling.
  masterSize: 3
  ClusterReplicas: 1
  image: redis:5.0.4-alpine

Backup and Restore

NOTE: Only Ceph S3 object storage and PVC is supported now

Backup

$ kubectl create -f deploy/example/backup-restore/redisclusterbackup_cr.yaml

Restore from backup

$ kubectl create -f deploy/example/backup-restore/restore.yaml

Prometheus Discovery

$ kubectl create -f deploy/example/prometheus-exporter.yaml

Create Redis Cluster with password

$ kubectl create -f deploy/example/custom-password.yaml

Persistent Volume

$ kubectl create -f deploy/example/persistent.yaml

Custom Configuration

$ kubectl create -f deploy/example/custom-config.yaml

Custom Service

$ kubectl create -f deploy/example/custom-service.yaml

Custom Resource

$ kubectl create -f deploy/example/custom-resources.yaml

ValidatingWebhook

see ValidatingWebhook

End to end tests

see e2e

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].