redis

Deploy Redis in-memory data store - supports Docker, Kubernetes, package manager, or source build

Recipaie - Receta de despliegue

La plantilla que describe cómo desplegar este servicio.

JSON sin procesar
{
  "$schema": "https://recipaie.com/schemas/recipaie.schema.json",
  "name": "redis",
  "version": "1.0.0",
  "description": "Deploy Redis in-memory data store - supports Docker, Kubernetes, package manager, or source build",
  "prerequisites": [
    "One of: Docker, Kubernetes cluster, Linux package manager (apt/yum), or build tools for source compilation",
    "Sufficient memory for your dataset (Redis keeps data in RAM)",
    "Persistent storage if data durability is required"
  ],
  "steps": [
    {
      "order": 1,
      "what": "Choose Redis variant and deployment method",
      "why": "Redis comes in multiple flavors with different features",
      "when": "Before installation",
      "how": "Decide: (1) Standard Redis - basic key-value, (2) Redis Stack - includes RediSearch, RedisJSON, RedisGraph, (3) Redis Cluster - for horizontal scaling. Then choose deployment: Docker, K8s, package manager, or source build",
      "verify": "Variant and method documented",
      "comments": [
        "Redis Stack recommended if you need search or JSON support",
        "Standard Redis is lighter (~5MB) vs Redis Stack (~50MB)",
        "For production: always configure persistence (RDB/AOF)"
      ]
    },
    {
      "order": 2,
      "what": "Create data directory for persistence",
      "why": "Redis can persist data to disk for durability",
      "when": "If data persistence is required",
      "skip_if": "Using ephemeral/cache-only Redis, or directory already exists",
      "how": "Create directory with appropriate permissions: mkdir -p /var/lib/redis && chown redis:redis /var/lib/redis (Linux), or use named volume (Docker), or PersistentVolumeClaim (K8s)",
      "verify": "Directory exists and is writable by Redis process",
      "comments": [
        "Path varies by environment - /var/lib/redis is Linux convention",
        "Docker: use named volumes for persistence across container restarts",
        "K8s: use PVC with appropriate storage class"
      ]
    },
    {
      "order": 3,
      "what": "Install or deploy Redis",
      "why": "Get Redis running in your environment",
      "when": "After prerequisites are ready",
      "skip_if": "Redis already installed and running at target version",
      "how": "Choose method: (Docker) docker run -d --name redis -p 6379:6379 redis:7-alpine, (Docker Stack) redis:7-alpine with volume mounts, (K8s) use Bitnami Redis Helm chart, (Ubuntu/Debian) apt install redis-server, (RHEL/CentOS) dnf install redis, (macOS) brew install redis, (Source) download from redis.io and make install",
      "verify": "redis-cli ping returns PONG",
      "comments": [
        "Use redis:7-alpine for minimal image size (~30MB)",
        "For Redis Stack: redis/redis-stack:latest or redis/redis-stack-server:latest",
        "Production: always set maxmemory and eviction policy"
      ]
    },
    {
      "order": 4,
      "what": "Configure Redis settings",
      "why": "Default settings are for development - production needs tuning",
      "when": "Before exposing to production traffic",
      "skip_if": "Using Redis only for development/testing",
      "how": "Edit redis.conf or pass config via command line: Set maxmemory (e.g., 2gb), maxmemory-policy (e.g., allkeys-lru), save intervals for RDB, appendonly yes for AOF, requirepass for authentication",
      "verify": "redis-cli CONFIG GET maxmemory shows expected value",
      "comments": [
        "Docker: mount custom redis.conf or use --redis-server args",
        "K8s: use ConfigMap for redis.conf",
        "Critical settings: maxmemory, persistence, authentication"
      ]
    },
    {
      "order": 5,
      "what": "Enable authentication",
      "why": "Protect Redis from unauthorized access",
      "when": "If Redis is network-accessible (not just localhost)",
      "skip_if": "Redis bound to localhost only and not exposed externally",
      "how": "Set password: redis-cli CONFIG SET requirepass 'your-secure-password', or in redis.conf: requirepass your-secure-password",
      "verify": "redis-cli AUTH your-secure-password returns OK, unauthenticated commands fail with NOAUTH",
      "comments": [
        "Redis 6+ supports ACLs for fine-grained permissions",
        "Never expose Redis to public internet without authentication",
        "Use strong passwords - Redis is fast at trying passwords too"
      ]
    },
    {
      "order": 6,
      "what": "Verify Redis is operational",
      "why": "Confirm the deployment is working correctly",
      "when": "After deployment and configuration",
      "how": "Test basic operations: SET testkey testvalue, GET testkey, DEL testkey. Check memory: INFO memory. Check persistence: LASTSAVE",
      "verify": "All operations succeed, memory usage within limits"
    }
  ],
  "step_count": 6
}
Versión: 1.0.0
Pasos: 6

Requisito previo

Pasos

1 Choose Redis variant and deployment method
Por qué
Redis comes in multiple flavors with different features
Cuándo
Before installation
Cómo
Decide: (1) Standard Redis - basic key-value, (2) Redis Stack - includes RediSearch, RedisJSON, RedisGraph, (3) Redis Cluster - for horizontal scaling. Then choose deployment: Docker, K8s, package manager, or source build
Verificar
Variant and method documented
Comentarios
  • Redis Stack recommended if you need search or JSON support
  • Standard Redis is lighter (~5MB) vs Redis Stack (~50MB)
  • For production: always configure persistence (RDB/AOF)
2 Create data directory for persistence
Por qué
Redis can persist data to disk for durability
Cuándo
If data persistence is required
Omitir si
Using ephemeral/cache-only Redis, or directory already exists
Cómo
Create directory with appropriate permissions: mkdir -p /var/lib/redis && chown redis:redis /var/lib/redis (Linux), or use named volume (Docker), or PersistentVolumeClaim (K8s)
Verificar
Directory exists and is writable by Redis process
Comentarios
  • Path varies by environment - /var/lib/redis is Linux convention
  • Docker: use named volumes for persistence across container restarts
  • K8s: use PVC with appropriate storage class
3 Install or deploy Redis
Por qué
Get Redis running in your environment
Cuándo
After prerequisites are ready
Omitir si
Redis already installed and running at target version
Cómo
Choose method: (Docker) docker run -d --name redis -p 6379:6379 redis:7-alpine, (Docker Stack) redis:7-alpine with volume mounts, (K8s) use Bitnami Redis Helm chart, (Ubuntu/Debian) apt install redis-server, (RHEL/CentOS) dnf install redis, (macOS) brew install redis, (Source) download from redis.io and make install
Verificar
redis-cli ping returns PONG
Comentarios
  • Use redis:7-alpine for minimal image size (~30MB)
  • For Redis Stack: redis/redis-stack:latest or redis/redis-stack-server:latest
  • Production: always set maxmemory and eviction policy
4 Configure Redis settings
Por qué
Default settings are for development - production needs tuning
Cuándo
Before exposing to production traffic
Omitir si
Using Redis only for development/testing
Cómo
Edit redis.conf or pass config via command line: Set maxmemory (e.g., 2gb), maxmemory-policy (e.g., allkeys-lru), save intervals for RDB, appendonly yes for AOF, requirepass for authentication
Verificar
redis-cli CONFIG GET maxmemory shows expected value
Comentarios
  • Docker: mount custom redis.conf or use --redis-server args
  • K8s: use ConfigMap for redis.conf
  • Critical settings: maxmemory, persistence, authentication
5 Enable authentication
Por qué
Protect Redis from unauthorized access
Cuándo
If Redis is network-accessible (not just localhost)
Omitir si
Redis bound to localhost only and not exposed externally
Cómo
Set password: redis-cli CONFIG SET requirepass 'your-secure-password', or in redis.conf: requirepass your-secure-password
Verificar
redis-cli AUTH your-secure-password returns OK, unauthenticated commands fail with NOAUTH
Comentarios
  • Redis 6+ supports ACLs for fine-grained permissions
  • Never expose Redis to public internet without authentication
  • Use strong passwords - Redis is fast at trying passwords too
6 Verify Redis is operational
Por qué
Confirm the deployment is working correctly
Cuándo
After deployment and configuration
Cómo
Test basic operations: SET testkey testvalue, GET testkey, DEL testkey. Check memory: INFO memory. Check persistence: LASTSAVE
Verificar
All operations succeed, memory usage within limits

Prodaie - Registro de ejecución

Qué ocurrió cuando una IA ejecutó esta receta en distintos entornos.

Diferencia clave: Cada paso añade los campos

success

(bool) y

details

(string) para registrar lo que ocurrió realmente.

JSON sin procesar
{
  "$schema": "https://recipaie.com/schemas/prodaie.schema.json",
  "name": "redis",
  "description": "Deployment record showing Redis in different environments: Docker, Kubernetes, and package manager",
  "locations": [
    {
      "path": "dev-laptop (Docker)",
      "description": "Local development using Docker",
      "status": "complete",
      "step_count": 6,
      "steps": [
        {
          "order": 1,
          "what": "Choose Redis variant and deployment method",
          "why": "Redis comes in multiple flavors with different features",
          "when": "Before installation",
          "how": "Decide variant and deployment method",
          "verify": "Variant and method documented",
          "success": true,
          "details": "chose Redis Stack for RediSearch support, Docker for isolation"
        },
        {
          "order": 2,
          "what": "Create data directory for persistence",
          "why": "Redis can persist data to disk for durability",
          "when": "If data persistence is required",
          "skip_if": "Using ephemeral Redis",
          "how": "Create named Docker volume",
          "verify": "Volume exists",
          "success": true,
          "details": "created volume: docker volume create redis-dev-data"
        },
        {
          "order": 3,
          "what": "Install or deploy Redis",
          "why": "Get Redis running in your environment",
          "when": "After prerequisites are ready",
          "skip_if": "Redis already running at target version",
          "how": "docker run with Redis Stack image",
          "verify": "redis-cli ping returns PONG",
          "success": true,
          "details": "docker run -d --name redis-dev -p 6379:6379 -v redis-dev-data:/data redis/redis-stack:latest"
        },
        {
          "order": 4,
          "what": "Configure Redis settings",
          "why": "Default settings are for development",
          "when": "Before exposing to production traffic",
          "skip_if": "Using Redis only for development",
          "how": "Set maxmemory and persistence",
          "verify": "CONFIG GET maxmemory shows value",
          "success": true,
          "details": "development use only, defaults are fine"
        },
        {
          "order": 5,
          "what": "Enable authentication",
          "why": "Protect Redis from unauthorized access",
          "when": "If Redis is network-accessible",
          "skip_if": "Redis bound to localhost only",
          "how": "Set requirepass",
          "verify": "Unauthenticated commands fail",
          "success": true,
          "details": "bound to localhost only via -p 127.0.0.1:6379:6379"
        },
        {
          "order": 6,
          "what": "Verify Redis is operational",
          "why": "Confirm the deployment is working correctly",
          "when": "After deployment and configuration",
          "how": "Test basic operations",
          "verify": "All operations succeed",
          "success": true,
          "details": "SET/GET/DEL working, FT._LIST confirms RediSearch loaded"
        }
      ]
    },
    {
      "path": "prod-cluster (Kubernetes)",
      "description": "Production Kubernetes cluster with HA",
      "status": "complete",
      "step_count": 6,
      "steps": [
        {
          "order": 1,
          "what": "Choose Redis variant and deployment method",
          "why": "Redis comes in multiple flavors",
          "when": "Before installation",
          "how": "Decide variant and deployment",
          "verify": "Variant and method documented",
          "success": true,
          "details": "chose standard Redis 7 with Sentinel for HA, Bitnami Helm chart"
        },
        {
          "order": 2,
          "what": "Create data directory for persistence",
          "why": "Redis can persist data to disk",
          "when": "If data persistence required",
          "skip_if": "Using PVC in Helm chart",
          "how": "Create PersistentVolumeClaim",
          "verify": "PVC bound",
          "success": true,
          "details": "Bitnami chart creates PVCs automatically"
        },
        {
          "order": 3,
          "what": "Install or deploy Redis",
          "why": "Get Redis running",
          "when": "After prerequisites ready",
          "skip_if": "Redis already running at target version",
          "how": "helm install redis bitnami/redis --set replica.replicaCount=3",
          "verify": "kubectl get pods shows all replicas Running",
          "success": true,
          "details": "1 master + 3 replicas deployed in redis namespace"
        },
        {
          "order": 4,
          "what": "Configure Redis settings",
          "why": "Production needs tuning",
          "when": "Before production traffic",
          "skip_if": "Using Helm values for config",
          "how": "Configure via Helm values",
          "verify": "CONFIG GET maxmemory shows expected",
          "success": true,
          "details": "set maxmemory=4gb, maxmemory-policy=allkeys-lru via values.yaml"
        },
        {
          "order": 5,
          "what": "Enable authentication",
          "why": "Protect Redis from unauthorized access",
          "when": "If network-accessible",
          "skip_if": "Password set via Helm",
          "how": "Helm chart creates Secret with password",
          "verify": "AUTH required to connect",
          "success": true,
          "details": "password in k8s secret redis-password, injected via REDIS_PASSWORD env"
        },
        {
          "order": 6,
          "what": "Verify Redis is operational",
          "why": "Confirm deployment works",
          "when": "After configuration",
          "how": "Port-forward and test",
          "verify": "All operations succeed",
          "success": true,
          "details": "kubectl port-forward svc/redis-master 6379:6379, all tests passed"
        }
      ]
    },
    {
      "path": "legacy-server (Ubuntu package)",
      "description": "Legacy Ubuntu server using apt package",
      "status": "complete",
      "step_count": 6,
      "steps": [
        {
          "order": 1,
          "what": "Choose Redis variant and deployment method",
          "why": "Redis comes in multiple flavors",
          "when": "Before installation",
          "how": "Decide variant and deployment",
          "verify": "Method documented",
          "success": true,
          "details": "chose standard Redis from Ubuntu repos, systemd for management"
        },
        {
          "order": 2,
          "what": "Create data directory for persistence",
          "why": "Redis needs persistent storage",
          "when": "If data persistence required",
          "skip_if": "Using default /var/lib/redis",
          "how": "Use default package paths",
          "verify": "Directory exists",
          "success": true,
          "details": "apt creates /var/lib/redis automatically"
        },
        {
          "order": 3,
          "what": "Install or deploy Redis",
          "why": "Get Redis running",
          "when": "After prerequisites ready",
          "skip_if": "Redis already at target version",
          "how": "apt install redis-server",
          "verify": "redis-cli ping returns PONG",
          "success": true,
          "details": "apt update && apt install -y redis-server, version 7.0.15"
        },
        {
          "order": 4,
          "what": "Configure Redis settings",
          "why": "Production needs tuning",
          "when": "Before production traffic",
          "skip_if": "Development only",
          "how": "Edit /etc/redis/redis.conf",
          "verify": "CONFIG GET maxmemory shows value",
          "success": true,
          "details": "set maxmemory 2gb, appendonly yes in /etc/redis/redis.conf"
        },
        {
          "order": 5,
          "what": "Enable authentication",
          "why": "Protect Redis",
          "when": "If network-accessible",
          "skip_if": "Localhost only",
          "how": "Set requirepass in config",
          "verify": "AUTH required",
          "success": true,
          "details": "added requirepass to /etc/redis/redis.conf, restarted service"
        },
        {
          "order": 6,
          "what": "Verify Redis is operational",
          "why": "Confirm deployment",
          "when": "After configuration",
          "how": "Test with redis-cli",
          "verify": "All operations succeed",
          "success": true,
          "details": "systemctl status redis-server shows active, SET/GET working"
        }
      ]
    }
  ]
}
Ubicaciones: 3

Ubicaciones

dev-laptop (Docker) complete

Local development using Docker

Pasos: 6
1 Choose Redis variant and deployment method
Por qué
Redis comes in multiple flavors with different features
Cuándo
Before installation
Cómo
Decide variant and deployment method
Verificar
Variant and method documented
Resultado
chose Redis Stack for RediSearch support, Docker for isolation
2 Create data directory for persistence
Por qué
Redis can persist data to disk for durability
Cuándo
If data persistence is required
Omitir si
Using ephemeral Redis
Cómo
Create named Docker volume
Verificar
Volume exists
Resultado
created volume: docker volume create redis-dev-data
3 Install or deploy Redis
Por qué
Get Redis running in your environment
Cuándo
After prerequisites are ready
Omitir si
Redis already running at target version
Cómo
docker run with Redis Stack image
Verificar
redis-cli ping returns PONG
Resultado
docker run -d --name redis-dev -p 6379:6379 -v redis-dev-data:/data redis/redis-stack:latest
4 Configure Redis settings
Por qué
Default settings are for development
Cuándo
Before exposing to production traffic
Omitir si
Using Redis only for development
Cómo
Set maxmemory and persistence
Verificar
CONFIG GET maxmemory shows value
Resultado
development use only, defaults are fine
5 Enable authentication
Por qué
Protect Redis from unauthorized access
Cuándo
If Redis is network-accessible
Omitir si
Redis bound to localhost only
Cómo
Set requirepass
Verificar
Unauthenticated commands fail
Resultado
bound to localhost only via -p 127.0.0.1:6379:6379
6 Verify Redis is operational
Por qué
Confirm the deployment is working correctly
Cuándo
After deployment and configuration
Cómo
Test basic operations
Verificar
All operations succeed
Resultado
SET/GET/DEL working, FT._LIST confirms RediSearch loaded
prod-cluster (Kubernetes) complete

Production Kubernetes cluster with HA

Pasos: 6
1 Choose Redis variant and deployment method
Por qué
Redis comes in multiple flavors
Cuándo
Before installation
Cómo
Decide variant and deployment
Verificar
Variant and method documented
Resultado
chose standard Redis 7 with Sentinel for HA, Bitnami Helm chart
2 Create data directory for persistence
Por qué
Redis can persist data to disk
Cuándo
If data persistence required
Omitir si
Using PVC in Helm chart
Cómo
Create PersistentVolumeClaim
Verificar
PVC bound
Resultado
Bitnami chart creates PVCs automatically
3 Install or deploy Redis
Por qué
Get Redis running
Cuándo
After prerequisites ready
Omitir si
Redis already running at target version
Cómo
helm install redis bitnami/redis --set replica.replicaCount=3
Verificar
kubectl get pods shows all replicas Running
Resultado
1 master + 3 replicas deployed in redis namespace
4 Configure Redis settings
Por qué
Production needs tuning
Cuándo
Before production traffic
Omitir si
Using Helm values for config
Cómo
Configure via Helm values
Verificar
CONFIG GET maxmemory shows expected
Resultado
set maxmemory=4gb, maxmemory-policy=allkeys-lru via values.yaml
5 Enable authentication
Por qué
Protect Redis from unauthorized access
Cuándo
If network-accessible
Omitir si
Password set via Helm
Cómo
Helm chart creates Secret with password
Verificar
AUTH required to connect
Resultado
password in k8s secret redis-password, injected via REDIS_PASSWORD env
6 Verify Redis is operational
Por qué
Confirm deployment works
Cuándo
After configuration
Cómo
Port-forward and test
Verificar
All operations succeed
Resultado
kubectl port-forward svc/redis-master 6379:6379, all tests passed
legacy-server (Ubuntu package) complete

Legacy Ubuntu server using apt package

Pasos: 6
1 Choose Redis variant and deployment method
Por qué
Redis comes in multiple flavors
Cuándo
Before installation
Cómo
Decide variant and deployment
Verificar
Method documented
Resultado
chose standard Redis from Ubuntu repos, systemd for management
2 Create data directory for persistence
Por qué
Redis needs persistent storage
Cuándo
If data persistence required
Omitir si
Using default /var/lib/redis
Cómo
Use default package paths
Verificar
Directory exists
Resultado
apt creates /var/lib/redis automatically
3 Install or deploy Redis
Por qué
Get Redis running
Cuándo
After prerequisites ready
Omitir si
Redis already at target version
Cómo
apt install redis-server
Verificar
redis-cli ping returns PONG
Resultado
apt update && apt install -y redis-server, version 7.0.15
4 Configure Redis settings
Por qué
Production needs tuning
Cuándo
Before production traffic
Omitir si
Development only
Cómo
Edit /etc/redis/redis.conf
Verificar
CONFIG GET maxmemory shows value
Resultado
set maxmemory 2gb, appendonly yes in /etc/redis/redis.conf
5 Enable authentication
Por qué
Protect Redis
Cuándo
If network-accessible
Omitir si
Localhost only
Cómo
Set requirepass in config
Verificar
AUTH required
Resultado
added requirepass to /etc/redis/redis.conf, restarted service
6 Verify Redis is operational
Por qué
Confirm deployment
Cuándo
After configuration
Cómo
Test with redis-cli
Verificar
All operations succeed
Resultado
systemctl status redis-server shows active, SET/GET working