Redis Cache Setup
Overview
Redis serves as a critical component for:
- Session management
- Real-time features
- Caching layer
- Performance optimization
Deployment Options
- Managed Service (Recommended)
- Helm Chart
Cloud Provider Options
Google Cloud Memorystore
- Enable and Configure
- Go to Google Cloud Console
- Enable Memorystore for Redis API
- Create new Redis instance:
- Choose Basic tier for standard workloads
- Select region (same as your GKE cluster)
- Set memory capacity (minimum 1GB)
- Enable authentication (recommended)
- Configure VPC network and authorized networks
Redis Cloud
- Create account at Redis Cloud
- Create new subscription:
- Fixed plan (minimum 1GB)
- Choose region
- Enable password protection
- Create database with default settings
Digital Ocean Redis
- Access Digital Ocean Console
- Create Database > Redis
- Configure:
- Choose smallest plan
- Select datacenter
- Enable eviction policy
tip
Managed services provide:
- Automatic backups
- High availability
- Security patches
- Performance monitoring
Bitnami Redis Chart
- Add repository:
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
- Install Redis:
helm upgrade --install redis oci://registry-1.docker.io/bitnamicharts/redis \
--namespace redis \
--version 18.19.2 \
--create-namespace \
--set architecture=standalone \
--set global.redis.password=your-secure-password
- Wait for deployment:
kubectl -n redis get pods -w
caution
For production use:
- Configure proper resource limits
- Set up persistence
- Consider high availability setup
Requirements
Minimum Specifications
- Redis 6.0 or higher
- 1GB memory
- Network access from platform
- Password protection enabled
Recommended Features
- Persistence enabled
- Automatic backups
- Monitoring setup
- Eviction policies configured
Information Collection
Required Values for Platform Installation
- Redis hostname/endpoint
- Port number (default: 6379)
- Password (if authentication enabled)
- TLS enabled/disabled
Example Helm Values
# values.yaml
redis:
# -- The redis host you collected in the prerequisites
host: ''
# -- The redis port you collected in the prerequisites
port: 6379
# -- The redis password you collected in the prerequisites
password: ''
# -- In shared redis servers, this prefix will separate out all queues
prefix: 'sm'
# -- Set to true if you want to use the TLS mode
tls: false
tip
When using Google Memorystore:
- Enable only one Redis solution (
redis.enabled
orredis.memorystore.enabled
) - Ensure your GKE cluster has access to the Memorystore instance
- Configure the same region as your GKE cluster
Validation
Test your Redis connection:
- Google Memorystore
- Standard Redis
# Get the Memorystore instance connection details
REDIS_HOST=$(gcloud redis instances describe [INSTANCE_ID] \
--region=[REGION] --format='get(host)')
REDIS_PORT=$(gcloud redis instances describe [INSTANCE_ID] \
--region=[REGION] --format='get(port)')
# Test connection using redis-cli
redis-cli -h $REDIS_HOST -p $REDIS_PORT ping
# Using redis-cli
redis-cli -h your-redis-host -p 6379 -a your-password ping
# Expected response
PONG
Troubleshooting
Common issues and solutions:
-
Connection Failures
- Verify credentials
- Check network/firewall rules
- Confirm TLS settings
- Validate endpoint format
- For Memorystore: verify VPC peering
-
Performance Issues
- Monitor memory usage
- Check eviction policies
- Review connection limits
- Verify resource allocation
- For Memorystore: check instance tier
Next Steps
- ✅ Set up Redis instance
- ✅ Configure security settings
- ➡️ Proceed to S3 Compatible Storage Setup
Need Help?
Contact [email protected] if you encounter any issues.