I am trying to get redis up and running in a Kubernetes environment. I’ve done many tutorials, read the documentation, etc. etc. I need to have the .rdb file and the .aof file(s) saved in a Persistent Volume so that the data can be persisted across Pod (or container) failures/deletions/etc. I have a redis instance starting, and I’m trying to use a custom config file. All the pods get created and run fine and the save
and appendonly
variables in the custom config file are updated/correct (the others are the default values). However, neither the daemonize
nor the dir
variables are updated. They remain the default values no matter what I do.
Custom config file:
daemonize yes
cluster-enabled no
dir /redis/storage
port 6397
save 60 5
save 300 1
appendonly yes
I’ve tried using a config map to create the custom config file then using the spec.template.spec.containers.command/spec.template.spec.containers.args
to copy the custom config file (named redis-stack.conf) to /etc/
, where there’s a redis-stack.conf file, which does get overwritten with the data in the custom config file. After the copy command, I have redis-stack-server /etc/redis-stack.conf
. When I do kubectl apply -f <filename>.conf
, then get a bash shell for one of the created pods and do redis-cli CONFIG GET DIR
it returns the default dir.
I’ve tried adding redis-cli CONFIG SET DIR <custom dir>
at the end of the spec.template.spec.containers.command/spec.template.spec.containers.args
string, but that didn’t work either. There are no errors in the logs and nothing but successful events.
I’ve searched the web, but the answers I’ve found that deal with a similar problem don’t solve my issue.
Any help is appreciated.