You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to have your thoughts so in development environment I can debug all GET/SET from the Redis cluster through the operator.
This one can be done by running a command redis-cli monitor (https://redis.io/commands/MONITOR) that watches all events and logs them (can be written to a file if wanted). But I don't know what would be the best practice to make it "embedded" with the operator.
Should the operator launch another container just doing sleep X && redis-cli monitor (the sleep would be to wait for the other container Redis server to be ready)? Or do you see something better? Maybe I should create this deployment on my own without relying on the operator?
In both cases, should my redis-cli monitor watches all the cluster, or just the master?
For now I'm using a "homemade" solution (another pod):
apiVersion: v1kind: Podmetadata:
name: redis-loggerspec:
containers:
- name: redis-loggerimage: redis:5-alpineimagePullPolicy: Always# Note: exclude all "ping" logs that are just noise# [WORKAROUND] For whatever reason even if the "grep" example is the best one it won't work within "command/args" on Kubernetes. Like if "grep -v XXX" was always considered as looking for "-v XXX" instead of excluding "XXX"# I did multiple attempts by quotes, using "command" array, "args" array... none worked whereas directly on the pod it works as expected. Anyway found a less precise but working filter with "awk" instead :)# command: ["/bin/sh", "-c", "/usr/local/bin/redis-cli -h $(REDIS_MASTER_HOST) -p $(REDIS_MASTER_PORT) MONITOR | grep -v \"] \\\"ping\\\"\""]command: ["/bin/sh", "-c", "/usr/local/bin/redis-cli -h $(REDIS_MASTER_HOST) -p $(REDIS_MASTER_PORT) MONITOR | awk !/\"ping\"/"]env:
- name: REDIS_MASTER_HOSTvalueFrom:
configMapKeyRef:
name: XXXXXXkey: redis.master.host
- name: REDIS_MASTER_PORTvalueFrom:
configMapKeyRef:
name: XXXXXXkey: redis.master.port
Hope it can help :)
The text was updated successfully, but these errors were encountered:
From amaizfinance/redis-operator#32:
Hi @nrvnrvn ,
I would like to have your thoughts so in development environment I can debug all GET/SET from the Redis cluster through the operator.
This one can be done by running a command
redis-cli monitor
(https://redis.io/commands/MONITOR) that watches all events and logs them (can be written to a file if wanted). But I don't know what would be the best practice to make it "embedded" with the operator.Should the operator launch another container just doing
sleep X && redis-cli monitor
(thesleep
would be to wait for the other container Redis server to be ready)? Or do you see something better? Maybe I should create this deployment on my own without relying on the operator?In both cases, should my
redis-cli monitor
watches all the cluster, or just the master?Thank you,
@sneko
For now I'm using a "homemade" solution (another pod):
Hope it can help :)
The text was updated successfully, but these errors were encountered: