redis
Container running redis.
Usage with docker
- Start :
REDIS_PASSWORD=ChangeIt docker compose up -d
- Note that redis is exposed on port 6379
- Test with embedded redis-cli :
docker exec -ti redis redis-cli
127.0.0.1:6379> AUTH ChangeIt
OK
127.0.0.1:6379> ping
PONG
127.0.0.1:6379> set mykey somevalue
OK
127.0.0.1:6379> get mykey
"somevalue"
127.0.0.1:6379> quit
Usage with Kubernetes
- Read k8s-install.sh and run :
REDIS_PASSWORD=ChangeIt bash k8s-install.sh
- Check pod status :
kubectl -n redis get pods
- Test with embedded client :
kubectl -n redis exec -ti redis-master-0 -- redis-cli
Resources
- redis.io - Documentation which includes Getting started with Redis
- redis.io - Commands
- geshan.com.np - Using Redis with docker and docker-compose for local development a step-by-step tutorial
- github.com - bitnami/redis
Client usage with PHP :