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.
The Kubernetes operator simplifies Redis Cluster management using the operator‑sdk based Undermoon project.
Usage
Build Helm Charts
make build-helmRunning 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.tgzCreate 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.tgzKey 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 mykeyScale 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.tgzSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
