Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .go-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.24.6
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0

# Use an official Golang image with a specific version
FROM golang:1.24.4 AS builder
FROM golang:1.24.6 AS builder

# Set environment variables
ENV GOPROXY=https://proxy.golang.org,direct
Expand Down
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
.DEFAULT_GOAL := help
SHELL := /bin/bash

name := redisrobin
name := redkeyrobin
VERSION := 1.0.0
package := github.com/inditextech/$(name)
# Image URL to use for building/pushing image targets when using `pro` deployment profile.
IMG ?= redis-robin:$(VERSION)
IMG ?= redkey-robin:$(VERSION)


# .............................................................................
Expand Down Expand Up @@ -71,7 +71,7 @@ endif

# Image URL to use for building/pushing image targets when using `dev` deployment profile.
# We always use version 0.1.0 for this purpose.
IMG_DEV ?= redis-robin:0.1.0-dev
IMG_DEV ?= redkey-robin:0.1.0-dev

# Image URL to use for deploying the operator pod when using `debug` deployment profile.
# A base golang image is used with Delve installed, in order to be able to remotely debug the manager.
Expand All @@ -84,8 +84,8 @@ IMAGE_REF ?= $(IMG)
# Allowed deploying profiles.
PROFILES := dev debug pro

# Namespace where redis robin is deployed.
NAMESPACE ?= redis-operator
# Namespace where redkey robin is deployed.
NAMESPACE ?= redkey-operator

# Deploying profile used to generate the manifest files to deploy the operator.
# The files to generate the manifests are kustomized from the directory config/deploy-profile/<PROFILE>.
Expand Down Expand Up @@ -222,24 +222,24 @@ debug-docker-push: ## Push docker image for debugging from debug.Dockerfile (use


##@ Deployment
REDIS_ROBIN=$(shell kubectl -n ${NAMESPACE} get po -l='redis.rediscluster.operator/component=robin' -o=jsonpath='{.items[0].metadata.name}')
REDKEY_ROBIN=$(shell kubectl -n ${NAMESPACE} get po -l='redis.redkeycluster.operator/component=robin' -o=jsonpath='{.items[0].metadata.name}')
dev-deploy: ## Build a new robin binary, copy the file to the webhook pod and run it.
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -gcflags="all=-N -l" -C robin -o ../bin/robin main.go
kubectl wait -n ${NAMESPACE} --for=condition=ready pod -l redis.rediscluster.operator/component=robin
kubectl cp ./bin/robin $(REDIS_ROBIN):/robin -n ${NAMESPACE}
kubectl exec -it po/$(REDIS_ROBIN) -n ${NAMESPACE} exec /robin
kubectl wait -n ${NAMESPACE} --for=condition=ready pod -l redis.redkeycluster.operator/component=robin
kubectl cp ./bin/robin $(REDKEY_ROBIN):/robin -n ${NAMESPACE}
kubectl exec -it po/$(REDKEY_ROBIN) -n ${NAMESPACE} exec /robin

debug: ## Build a new robin binary, copy the file to the pod and run it in debug mode (listening on port 40000 for Delve connections).
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -gcflags="all=-N -l" -o bin/robin ./cmd/main.go
kubectl wait -n ${NAMESPACE} --for=condition=ready pod -l redis.rediscluster.operator/component=robin
kubectl cp ./bin/robin $(REDIS_ROBIN):/robin -n ${NAMESPACE}
kubectl exec -it po/$(REDIS_ROBIN) -n ${NAMESPACE} -- dlv --listen=:40000 --headless=true --api-version=2 --accept-multiclient exec /robin --continue
kubectl wait -n ${NAMESPACE} --for=condition=ready pod -l redis.redkeycluster.operator/component=robin
kubectl cp ./bin/robin $(REDKEY_ROBIN):/robin -n ${NAMESPACE}
kubectl exec -it po/$(REDKEY_ROBIN) -n ${NAMESPACE} -- dlv --listen=:40000 --headless=true --api-version=2 --accept-multiclient exec /robin --continue

port-forward: ## Port forwarding of port 40000 for debugging robin with Delve.
kubectl port-forward pod/$(REDIS_ROBIN) 40000:40000 -n ${NAMESPACE}
kubectl port-forward pod/$(REDKEY_ROBIN) 40000:40000 -n ${NAMESPACE}

port-forward-metrics: ## Port forwarding of port 8080 for debugging the manager with Delve.
kubectl port-forward pod/$(REDIS_ROBIN) 8080:8080 -n ${NAMESPACE}
kubectl port-forward pod/$(REDKEY_ROBIN) 8080:8080 -n ${NAMESPACE}

##@ Test
ginkgo:
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@ SPDX-License-Identifier: Apache-2.0
-->

<!-- Add relevant badges here -->
![GitHub License](https://img.shields.io/github/license/InditexTech/redisrobin)
![GitHub License](https://img.shields.io/github/license/InditexTech/redkeyrobin)

# Redis Robin
# RedKey Robin

Redis Robin is a faithful partner who assists the [Redis Operator](https://github.com/InditexTech/redisoperator) in the dangerous Gotham. It is designed to help the Operator (Batman) in its duties and deployed by the Redis Operator as a Deployment.
RedKey Robin is a faithful partner who assists the [RedKey Operator](https://github.com/InditexTech/redkeyoperator) in the dangerous Gotham. It is designed to help the Operator (Batman) in its duties and deployed by the RedKey Operator as a Deployment.

## Features

- Redis metrics
- TODO: future work
- Monitors the RedKey Cluster to ensure it is well-formed and balanced, performing the necessary operations to achieve this
- Exposes an API to the RedKey Operator so that it can query the status of the RedKey Cluster and perform scaling and upgrading operations

## Getting Started

Please refer to the [developer guide](./docs/developer-guide.md) to have more information about how to use, develop and deploy Redis Robin.
Please refer to the [developer guide](./docs/developer-guide.md) to have more information about how to use, develop and deploy RedKey Robin.

## Contributing

Expand Down
7 changes: 4 additions & 3 deletions REUSE.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version = 1
SPDX-PackageName = "redisrobin"
SPDX-PackageName = "redkeyrobin"
SPDX-PackageSupplier = "2025 INDUSTRIA DE DISEÑO TEXTIL S.A. (INDITEX S.A.)"
SPDX-PackageDownloadLocation = "https://github.com/InditexTech/redisrobin"
SPDX-PackageDownloadLocation = "https://github.com/InditexTech/redkeyrobin"

[[annotations]]
path = [
Expand All @@ -12,7 +12,8 @@ path = [
"go.sum",
"api/openapi-rest.yml",
"local/configmap.yml",
"docs/images/redis-robin-architecture.png",
"docs/images/redkey-robin-architecture.png",
".go-version",
]
SPDX-FileCopyrightText = "2025 INDUSTRIA DE DISEÑO TEXTIL S.A. (INDITEX S.A.)"
SPDX-License-Identifier = "Apache-2.0"
100 changes: 50 additions & 50 deletions api/openapi-rest.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
openapi: 3.0.4
info:
title: Swagger Redis Robin
title: Swagger RedKey Robin
description: |-
Api developed for Redis Robin, a faithful partner who assists the operator in the dangerous Gotham.
Api developed for RedKey Robin, a faithful partner who assists the operator in the dangerous Gotham.
contact:
email: lddpaas@inditex.com
version: 1.0.0
externalDocs:
description: Find out more about Redis Operator
description: Find out more about RedKey Operator
url: https://redis-sentinel.docs.inditex.dev/redis-at-inditex/latest/redis-ops-guide/deployment.html
servers:
- url: https://api.inditex.com/redisrobin
- url: https://api.inditex.com/redkeyrobin
description: Production server
tags:
- name: status
description: Redis cluster status
description: RedKey cluster status
- name: replicas
description: Redis cluster replicas
description: RedKey cluster replicas
- name: move
description: Redis cluster reshard
description: RedKey cluster reshard
- name: metrics
description: Redis cluster metrics
description: RedKey cluster metrics
- name: check
description: Redis cluster check
description: RedKey cluster check
- name: fix
description: Redis cluster fix
description: RedKey cluster fix
- name: reset
description: Redis cluster node reset
description: RedKey cluster node reset
- name: nodes
description: Redis cluster nodes
description: RedKey cluster nodes

paths:
/v1/rediscluster/status:
/v1/redkeycluster/status:
get:
tags:
- status
summary: Get current Redis Cluster status
description: Get current Redis Cluster status from Redis Operator perspective
operationId: GetRedisClusterStatus
summary: Get current RedKey Cluster status
description: Get current RedKey Cluster status from RedKey Operator perspective
operationId: GetRedKeyClusterStatus
responses:
'200':
description: Return current status
content:
application/json:
schema:
$ref: '#/components/schemas/RedisClusterStatusResponse'
$ref: '#/components/schemas/RedKeyClusterStatusResponse'
put:
tags:
- status
summary: Update Redis Cluster status
description: Update Redis Cluster status
operationId: UpdateRedisClusterStatus
summary: Update RedKey Cluster status
description: Update RedKey Cluster status
operationId: UpdateRedKeyClusterStatus
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RedisClusterStatusRequest'
$ref: '#/components/schemas/RedKeyClusterStatusRequest'
responses:
'200':
description: Return updated status
content:
application/json:
schema:
$ref: '#/components/schemas/RedisClusterStatusResponse'
$ref: '#/components/schemas/RedKeyClusterStatusResponse'

/v1/cluster/replicas:
/v1/redkeycluster/replicas:
get:
tags:
- replicas
Expand Down Expand Up @@ -108,7 +108,7 @@ paths:
tags:
- status
summary: Get current Cluster status
description: Get current Cluster status from Redis Robin perspective
description: Get current Cluster status from RedKey Robin perspective
operationId: GetClusterStatus
responses:
'200':
Expand All @@ -122,8 +122,8 @@ paths:
put:
tags:
- move
summary: Move slots between Redis Nodes
description: Move slots between Redis Nodes
summary: Move slots between Nodes
description: Move slots between Nodes
operationId: MoveNodeSlots
requestBody:
content:
Expand Down Expand Up @@ -221,12 +221,12 @@ paths:

components:
schemas:
RedisClusterStatusResponse:
RedKeyClusterStatusResponse:
type: object
properties:
status:
type: string
description: Redis Cluster Status
description: RedKey Cluster Status
example: Ready
enum:
- Initializing
Expand All @@ -237,12 +237,12 @@ components:
- ScalingUp
- Maintenance
- Unknown
RedisClusterStatusRequest:
RedKeyClusterStatusRequest:
type: object
properties:
status:
type: string
description: Redis Cluster Status
description: RedKey Cluster Status
example: Ready
enum:
- Initializing
Expand Down Expand Up @@ -282,7 +282,7 @@ components:
properties:
status:
type: string
description: Redis Cluster Status
description: RedKey Cluster Status
example: Ready
enum:
- Ready
Expand All @@ -308,12 +308,12 @@ components:
properties:
from:
type: string
description: Redis Cluster node to move slots from. Can be the name name or the node index
description: RedKey Cluster node to move slots from. Can be the name name or the node index
example: "0"
to:
type: string
description: Redis Cluster node to move slots to. Can be the name name or the node index
example: rediscluster-sample-1
description: RedKey Cluster node to move slots to. Can be the name name or the node index
example: redkeycluster-sample-1
slots:
type: integer
description: Slots to move. If not provided, all slots will be moved
Expand All @@ -335,28 +335,28 @@ components:
properties:
status:
type: string
description: Redis Cluster check status
description: RedKey Cluster check status
example: Completed
enum:
- Completed
- Error
result:
type: string
description: Redis Cluster check result
description: RedKey Cluster check result
example: OK
enum:
- OK
- Error
error:
type: string
description: Redis Cluster check error
description: RedKey Cluster check error
example: Error message
ClusterFixResponse:
type: object
properties:
status:
type: string
description: Redis Cluster fix status
description: RedKey Cluster fix status
example: InProgress
enum:
- InProgress
Expand All @@ -366,25 +366,25 @@ components:
properties:
nodes:
type: array
description: Redis Cluster nodes
description: RedKey Cluster nodes
items:
type: object
properties:
id:
type: string
description: Redis Cluster node ID
description: RedKey Cluster node ID
example: c3f4bad062e19339e0e07bb836db5e23f09f0dff
name:
type: string
description: Redis Cluster node name
example: rediscluster-sample-0
description: RedKey Cluster node name
example: redkeycluster-sample-0
flags:
type: string
description: Redis Cluster node flags
description: RedKey Cluster node flags
example: master
slots:
type: array
description: Redis Cluster node slots
description: RedKey Cluster node slots
items:
type: array
items:
Expand All @@ -400,25 +400,25 @@ components:
example: 16383
ip:
type: string
description: Redis Cluster node IP
description: RedKey Cluster node IP
example: "10.0.0.1"
masterId:
type: string
description: Redis Cluster node master ID
description: RedKey Cluster node master ID
example: c3f4bad062e19339e0e07bb836db5e23f09f0dff
failures:
type: integer
description: Redis Cluster node failures
description: RedKey Cluster node failures
example: 0
sent:
type: integer
description: Redis Cluster node sent
description: RedKey Cluster node sent
example: 0
recv:
type: integer
description: Redis Cluster node recv
description: RedKey Cluster node recv
example: 0
linkStatus:
type: string
description: Redis Cluster node link status
description: RedKey Cluster node link status
example: connected
Loading
Loading