redis
Deploy Redis in-memory data store - supports Docker, Kubernetes, package manager, or source build
Recipaie - 배포 레시피
이 서비스를 어떻게 배포하는지 설명하는 템플릿입니다.
원본 JSON
{
"$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
}
사전 조건
One of: Docker, Kubernetes cluster, Linux package manager (apt/yum), or build tools for source compilationSufficient memory for your dataset (Redis keeps data in RAM)Persistent storage if data durability is required
단계
1 Choose Redis variant and deployment method
- 이유
- Redis comes in multiple flavors with different features
- 시점
- Before installation
- 방법
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- 검증
- Variant and method documented
- 비고
- 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
- 이유
- Redis can persist data to disk for durability
- 시점
- If data persistence is required
- 건너뛰는 조건
- Using ephemeral/cache-only Redis, or directory already exists
- 방법
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)- 검증
- Directory exists and is writable by Redis process
- 비고
- 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
- 이유
- Get Redis running in your environment
- 시점
- After prerequisites are ready
- 건너뛰는 조건
- Redis already installed and running at target version
- 방법
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- 검증
- redis-cli ping returns PONG
- 비고
- 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
- 이유
- Default settings are for development - production needs tuning
- 시점
- Before exposing to production traffic
- 건너뛰는 조건
- Using Redis only for development/testing
- 방법
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- 검증
- redis-cli CONFIG GET maxmemory shows expected value
- 비고
- Docker: mount custom redis.conf or use --redis-server args
- K8s: use ConfigMap for redis.conf
- Critical settings: maxmemory, persistence, authentication
5 Enable authentication
- 이유
- Protect Redis from unauthorized access
- 시점
- If Redis is network-accessible (not just localhost)
- 건너뛰는 조건
- Redis bound to localhost only and not exposed externally
- 방법
Set password: redis-cli CONFIG SET requirepass 'your-secure-password', or in redis.conf: requirepass your-secure-password- 검증
- redis-cli AUTH your-secure-password returns OK, unauthenticated commands fail with NOAUTH
- 비고
- 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
- 이유
- Confirm the deployment is working correctly
- 시점
- After deployment and configuration
- 방법
Test basic operations: SET testkey testvalue, GET testkey, DEL testkey. Check memory: INFO memory. Check persistence: LASTSAVE- 검증
- All operations succeed, memory usage within limits
Prodaie - 실행 기록
AI가 이 레시피를 서로 다른 환경에서 실행했을 때 일어난 일입니다.
핵심 차이: 각 단계에는 success details (bool) 및 (string) 필드가 추가되어 실제로 무슨 일이 있었는지 기록합니다.
원본 JSON
{
"$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"
}
]
}
]
}
설치 위치
dev-laptop (Docker) complete
Local development using Docker
1 Choose Redis variant and deployment method ✓
- 이유
- Redis comes in multiple flavors with different features
- 시점
- Before installation
- 방법
Decide variant and deployment method- 검증
- Variant and method documented
- 결과
- ✓ chose Redis Stack for RediSearch support, Docker for isolation
2 Create data directory for persistence ✓
- 이유
- Redis can persist data to disk for durability
- 시점
- If data persistence is required
- 건너뛰는 조건
- Using ephemeral Redis
- 방법
Create named Docker volume- 검증
- Volume exists
- 결과
- ✓ created volume: docker volume create redis-dev-data
3 Install or deploy Redis ✓
- 이유
- Get Redis running in your environment
- 시점
- After prerequisites are ready
- 건너뛰는 조건
- Redis already running at target version
- 방법
docker run with Redis Stack image- 검증
- redis-cli ping returns PONG
- 결과
- ✓ docker run -d --name redis-dev -p 6379:6379 -v redis-dev-data:/data redis/redis-stack:latest
4 Configure Redis settings ✓
- 이유
- Default settings are for development
- 시점
- Before exposing to production traffic
- 건너뛰는 조건
- Using Redis only for development
- 방법
Set maxmemory and persistence- 검증
- CONFIG GET maxmemory shows value
- 결과
- ✓ development use only, defaults are fine
5 Enable authentication ✓
- 이유
- Protect Redis from unauthorized access
- 시점
- If Redis is network-accessible
- 건너뛰는 조건
- Redis bound to localhost only
- 방법
Set requirepass- 검증
- Unauthenticated commands fail
- 결과
- ✓ bound to localhost only via -p 127.0.0.1:6379:6379
6 Verify Redis is operational ✓
- 이유
- Confirm the deployment is working correctly
- 시점
- After deployment and configuration
- 방법
Test basic operations- 검증
- All operations succeed
- 결과
- ✓ SET/GET/DEL working, FT._LIST confirms RediSearch loaded
prod-cluster (Kubernetes) complete
Production Kubernetes cluster with HA
1 Choose Redis variant and deployment method ✓
- 이유
- Redis comes in multiple flavors
- 시점
- Before installation
- 방법
Decide variant and deployment- 검증
- Variant and method documented
- 결과
- ✓ chose standard Redis 7 with Sentinel for HA, Bitnami Helm chart
2 Create data directory for persistence ✓
- 이유
- Redis can persist data to disk
- 시점
- If data persistence required
- 건너뛰는 조건
- Using PVC in Helm chart
- 방법
Create PersistentVolumeClaim- 검증
- PVC bound
- 결과
- ✓ Bitnami chart creates PVCs automatically
3 Install or deploy Redis ✓
- 이유
- Get Redis running
- 시점
- After prerequisites ready
- 건너뛰는 조건
- Redis already running at target version
- 방법
helm install redis bitnami/redis --set replica.replicaCount=3- 검증
- kubectl get pods shows all replicas Running
- 결과
- ✓ 1 master + 3 replicas deployed in redis namespace
4 Configure Redis settings ✓
- 이유
- Production needs tuning
- 시점
- Before production traffic
- 건너뛰는 조건
- Using Helm values for config
- 방법
Configure via Helm values- 검증
- CONFIG GET maxmemory shows expected
- 결과
- ✓ set maxmemory=4gb, maxmemory-policy=allkeys-lru via values.yaml
5 Enable authentication ✓
- 이유
- Protect Redis from unauthorized access
- 시점
- If network-accessible
- 건너뛰는 조건
- Password set via Helm
- 방법
Helm chart creates Secret with password- 검증
- AUTH required to connect
- 결과
- ✓ password in k8s secret redis-password, injected via REDIS_PASSWORD env
6 Verify Redis is operational ✓
- 이유
- Confirm deployment works
- 시점
- After configuration
- 방법
Port-forward and test- 검증
- All operations succeed
- 결과
- ✓ kubectl port-forward svc/redis-master 6379:6379, all tests passed
legacy-server (Ubuntu package) complete
Legacy Ubuntu server using apt package
1 Choose Redis variant and deployment method ✓
- 이유
- Redis comes in multiple flavors
- 시점
- Before installation
- 방법
Decide variant and deployment- 검증
- Method documented
- 결과
- ✓ chose standard Redis from Ubuntu repos, systemd for management
2 Create data directory for persistence ✓
- 이유
- Redis needs persistent storage
- 시점
- If data persistence required
- 건너뛰는 조건
- Using default /var/lib/redis
- 방법
Use default package paths- 검증
- Directory exists
- 결과
- ✓ apt creates /var/lib/redis automatically
3 Install or deploy Redis ✓
- 이유
- Get Redis running
- 시점
- After prerequisites ready
- 건너뛰는 조건
- Redis already at target version
- 방법
apt install redis-server- 검증
- redis-cli ping returns PONG
- 결과
- ✓ apt update && apt install -y redis-server, version 7.0.15
4 Configure Redis settings ✓
- 이유
- Production needs tuning
- 시점
- Before production traffic
- 건너뛰는 조건
- Development only
- 방법
Edit /etc/redis/redis.conf- 검증
- CONFIG GET maxmemory shows value
- 결과
- ✓ set maxmemory 2gb, appendonly yes in /etc/redis/redis.conf
5 Enable authentication ✓
- 이유
- Protect Redis
- 시점
- If network-accessible
- 건너뛰는 조건
- Localhost only
- 방법
Set requirepass in config- 검증
- AUTH required
- 결과
- ✓ added requirepass to /etc/redis/redis.conf, restarted service
6 Verify Redis is operational ✓
- 이유
- Confirm deployment
- 시점
- After configuration
- 방법
Test with redis-cli- 검증
- All operations succeed
- 결과
- ✓ systemctl status redis-server shows active, SET/GET working