Remove support for setting Redis config file paths via environment variables
High traffic GitLab instances can split their Redis workload across multiple Redis instances (for example Redis::Cache
, Redis::Queues
). To configure these Redis instances you can use dedicated config files config/redis.cache.yml
, config/redis.queues.yml
etc. It is also possible to set the locations of these config files via environment variables GITLAB_REDIS_CACHE_CONFIG_FILE
, GITLAB_REDIS_QUEUES_CONFIG_FILE
etc.
This issue is for removing the environment variable mechanism for setting Redis config file paths.
These environment variables complicate our Redis configuration logic and they offer no real benefit to administrators or distributors of GitLab. GitLab has many config files and when you install it, these config files must be placed in config/
. This is a Ruby on Rails convention. Anybody who installs GitLab has to create and maintain config files in config/
one way or another. You gain nothing by keeping a few Redis config files in a separate directory.
We should deprecate these environment variables as soon as possible and then remove them in the next major release. Anybody who is using these environment variables should switch to writing their Redis config files to the default location in config/
.
Who is affected
- Possibly, administrators of GitLab instance that use an unofficial installation method
- Administrators of GitLab installations using an official installation method, but who chose to override their Redis configuration in an undocumented way
To see if your GitLab installation is using these environment variables, run the following snippet in a Rails console:
keys = ENV.keys.grep(/^GITLAB_REDIS[A-Z_]*_CONFIG_FILE$/)
raise "detected deprecated environment variables: #{keys.join(', ')}" unless keys.empty?
Mitigation
Please use the standard Redis configuration mechanisms built into Omnibus and the GitLab Helm Charts.