Provide options to configure workhorse redis without using global defaults
Currently, in omnibus and charts, workhorse uses the global Redis configuration:
- omnibus: https://gitlab.com/gitlab-org/omnibus-gitlab/-/blob/cf6d0013fcc8d2fa820cd840c280ead6fe0b1e07/files/gitlab-cookbooks/gitlab/recipes/gitlab-workhorse.rb#L93
- charts: https://gitlab.com/gitlab-org/charts/gitlab/-/blob/77cbf0d82c72b417137bd86fc6c8efdf69ff5f8e/charts/gitlab/charts/webservice/templates/configmap.yml#L200
This $.Values.global.redis
is also used by Rails to configure Gitlab::Redis::SharedState
. However, we can configure SharedState
via global.redis.sharedState
which we do in k8s-workload.
Changing the global.redis
is not advised since that Redis is a fall-back and is used to populate the resque.yml
configuration file.
Proposal
By adding an option to configure Redis for workhorse via .Values.global.redis.workhorse
which will be used by both Rails via config/redis.workhorse.yml
and workhorse via config.toml
, we can safely introduce a Redis instance for workhorse-specific operations.
To avoid any breaking changes, charts should only use the new Redis configuration for workhorse if it exists, falling back to global.redis
. The same non-breaking approach applies to omnibus-gitlab
.
An MR gitlab-org/gitlab!127577 (merged) will update the rails application to read from either the workhorse
field in config/redis.yml
or config/redis.workhorse.yml
.