-
Notifications
You must be signed in to change notification settings - Fork 1
Redis
Fernanda Scovino edited this page Sep 6, 2022
·
5 revisions
- In your shell, access your Redis server on k8s by running:
kubectl port-forward svc/redis -n <your-namespace> 6379:6379
We use
redis
namespace by default on k8s
- Then you can access Redis on your localhost:6379
# first, make sure to install:
# pip install redis-pal
from redis_pal import RedisPal
redis_client = RedisPal(host="...", port=XXXX)
- If running local, set:
redis_client = RedisPal(host="localhost", port=6379)
- Get value by key:
redis_client.get(key)
- Set new value/key (or change value already set on that key):
redis_client.set(key, value)