0

I am looking for some guidance on sentinel setup in kubernetes. Problem i am facing is as follows. Sentinel process to start, a config file(sentinel.conf) has to be passed as command line argument and file must be writeable by the sentinel process.

I have generated the sentinel.conf config file through kubernetes configmap volume mount. but the generated config file can only be read only. kubernetes does not allow it to be writeable.

To circumvent this issue i copied the generated config file to a new config file and made it writeable. Then passed the new file to the sentinel process. This i have done in a start script. can also be done through init container. so far so good.

issues i am facing with this approach is... Every time the container restart the config file copy step will be executed and any changes made in the config file by sentinel process will be lost. will it be an issue if the changes made to the config file are lost after restart of sentinel process ?

If anyone faced this issue and resolved it please guide me. My redis version is 6.2.1

dsingh
  • 571
  • 2
  • 7
  • 17

1 Answers1

0

You can store the redis.conf file inside a persistent volume

Besides that, in your init container script, check if redis.conf already exists. If it does, do not copy it. If it does not, it is the first time, so copy it.

You can see something similar here and here. I am not the author of these links. But I find them very helpful

usuario
  • 2,132
  • 1
  • 10
  • 26
  • Issue with this approach is if any config is changed in the file generated through configmap then it will not be reflected in the config file on persistent volume because it won't be copied by the start script since file on the persistent storage already exist. – dsingh Aug 09 '21 at 03:38