dragonflydb / dragonfly-operator

A Kubernetes operator to install and manage Dragonfly instances.
https://www.dragonflydb.io/docs/managing-dragonfly/operator/installation
Apache License 2.0
146 stars 34 forks source link

How to configure values like --maxmemory-policy #254

Closed cristianrat closed 3 weeks ago

cristianrat commented 1 month ago

Currently running this in k8s and would like to customize the value for this config --maxmemory-policy Doesn't seem there is an easy way to do this. I see faqs reference redis.conf file (which doesn't exist by default) or the redis-cli command to set it (which is not persisted) So the question, how can I configure this with k8s - is there an env variable I am missing, or would simply adding a redis.conf file suffice?

Abhra303 commented 1 month ago

You can simply pass the desired flag in args list. e.g.

spec:
  args:
   - "maxmemory=..."
cristianrat commented 1 month ago

You can simply pass the desired flag in args list. e.g.

spec:
  args:
   - "maxmemory=..."

That doesn't really work, I already tried that. I am already using args to set my snapshot name. maxmemory may work, but it's not the same as maxmemory-policy (https://redis.io/docs/latest/develop/reference/eviction/)

Abhra303 commented 1 month ago

If you want cache mode, you can use --cache_mode. Here is the arg reference - https://www.dragonflydb.io/docs/managing-dragonfly/flags#available-flags. You can also ask in our dragonfly repo or discord to get help.

cristianrat commented 1 month ago

If you want cache mode, you can use --cache_mode. Here is the arg reference - https://www.dragonflydb.io/docs/managing-dragonfly/flags#available-flags. You can also ask in our dragonfly repo or discord to get help.

ah, cheers for that I guess that could work (although my instance is not just a cache) How does setting cache_mode on work - will it evict randomly, or least used or? I'll join the discord as well, thank you