Geo: POC Allow promotion task to alter node configuration
Problem to solve
Currently, setting a GitLab instance as a Geo primary or secondary depends on the roles[]
and additional configuration in gitlab.rb
. This means that changing this role requires editing this file and reconfiguring. This is simple enough on a single-server installation but may entail dozens of edits when running a scaled reference architecture. In order to create a single command to promote a primary to a secondary, a mechanism is required to alter this configuration using some gitlab-ctl
command.
Proposal
- Explore mechanisms to change the configuration of a Geo node via a script,
gitlab-ctl
command or similar - The approach used should not limit a future orchestration effort, see &3131 (comment 342659668)
Illustration
Let's imagine a Geo deployment with an unvailable primary site and a secondary site with 5 nodes.
graph TD
subgraph Geo deployment
subgraph Primary[Primary site, multi-node, unvailable]
style Primary fill:#ABB5BF
end
subgraph Secondary1[Secondary site 1, multi-node]
Node_1[Application node]
Node_2[Database node]
Node_3[Redis node]
Node_4[Gitaly node]
Node_5[Tracking DB node]
end
end
In order for a promotion to happen a systems administrator must edit the gitlab.rb file on each node:
for node in nodes:
edit gitlab.rb
run gitlab-ctl reconfigure
end
Desired situation for the POC
for node in nodes:
run gitlab-ctl promote-to-primary-node
end
The command should take care of altering the configuration.
Success
TBD