Cloud Native 5 min read

How to Install and Manage a Redis Cluster with the Undermoon Operator

This guide walks through building Helm charts, deploying the Undermoon operator, creating and scaling a Redis Cluster on Kubernetes, and configuring the undermoon‑scheduler to ensure master‑replica placement across nodes, with detailed commands and parameter explanations.

Hacker Afternoon Tea
Hacker Afternoon Tea
Hacker Afternoon Tea
How to Install and Manage a Redis Cluster with the Undermoon Operator

The Kubernetes operator simplifies Redis Cluster management using the operator‑sdk based Undermoon project.

Usage

Build Helm Charts

make build-helm

Running the command creates three Helm packages in the current directory:

undermoon-operator-0.4.1.tgz

undermoon-cluster-0.4.1.tgz

undermoon-scheduler-0.4.1.tgz

Run Operator

Install the operator (the release name can be changed):

helm install my-undermoon-operator undermoon-operator-0.4.1.tgz

Create an Undermoon Cluster

Install a cluster with custom parameters via the Helm chart:

helm install \
    --set 'cluster.clusterName=my-cluster-name' \
    --set 'cluster.chunkNumber=1' \
    --set 'cluster.maxMemory=2048' \
    --set 'cluster.port=5299' \
    my-cluster \
    -n my-namespace \
    undermoon-cluster-0.4.1.tgz

Key fields: clusterName: name of the cluster, must be less than 30 bytes and cannot be changed. chunkNumber: number of chunks; each chunk consists of 2 masters and 2 replicas. Adjust to scale the cluster. maxMemory: sets each Redis node's maxmemory in MB; changing this triggers a rolling upgrade. port: service port for Redis clients; this value is immutable.

Access the service from within the Kubernetes cluster:

# This runs only inside the K8s cluster.
redis-cli -h my-cluster.my-namespace.svc.cluster.local -p 5299 -c get mykey

Scale the Cluster

kubectl edit undermoon/my-cluster
# Modify `chunkNumber`, then save and exit.

The cluster automatically expands after the edit.

Use undermoon‑scheduler

By default Undermoon does not guarantee that the master and replica Redis instances of the same shard run on different nodes. To enforce this placement, install the scheduler based on the Kubernetes scheduling framework:

helm install example-scheduler -n my-namespace "undermoon-scheduler-0.4.1.tgz"

When installing the cluster, specify the scheduler name:

helm install \
    --set 'cluster.clusterName=my-cluster-name' \
    --set 'cluster.chunkNumber=1' \
    --set 'cluster.maxMemory=2048' \
    --set 'cluster.port=5299' \
    --set "schedulerName=undermoon-scheduler" \
    my-cluster \
    -n my-namespace \
    undermoon-cluster-0.4.1.tgz
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

cloud nativekubernetesOperatorRedisSchedulerHelmUndermoon
Hacker Afternoon Tea
Written by

Hacker Afternoon Tea

You might find something interesting here ^_^

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.