Skip to content

Cells: Make topology service work on non-main cells

Peter Leitzen requested to merge pl-cells-topology-config into main

What does this merge request do and why?

Prior this commit, running gdk cells up would enable topology server in cells and use cells' host, port, and certs.

Since cells should connect to the main cell (cell 0) this commit fixes this behaviour:

  • Disable topology service server
  • Enable topology service client
  • Use main cell's host, port, and certs for the topology service client

This MR also fixes the use case when Cell's configuration does not exist yet. See 9890a470 (comment 2159020680).

How to set up and validate locally

  1. Enable cells and topology service via
gdk config set cells.enabled true
gdk config set cells.instance_count 3
gdk config set gitlab_topology_service.enabled true
  1. Run gdk reconfigure and gdk cells up

  2. Inspect cell's gdk.yml which should look like:

# This configuration was generated by `gdk cells up` on 2024-10-15 12:35:57 +0200.
#
# Do not change this file!
# Change `/home/peter/devel/gitlab/gdk/gdk.yml` instead and rerun the command.
---
cells:
  enabled: false
  port_offset: 12000
gitlab:
  topology_service:
    address: 10.23.0.5:9095
    ca_file: "/home/peter/devel/gitlab/gdk/gitlab-topology-service/tmp/certs/ca-cert.pem"
    certificate_file: "/home/peter/devel/gitlab/gdk/gitlab-topology-service/tmp/certs/client-cert.pem"
    enabled: true
    private_key_file: "/home/peter/devel/gitlab/gdk/gitlab-topology-service/tmp/certs/client-key.pem"
gitlab_http_router:
  enabled: false
  gitlab_rules_config: session_prefix
gitlab_topology_service:
  enabled: false
hostname: 10.23.0.5
listen_address: 10.23.0.5
vite:
  enabled: true
webpack:
  enabled: false
  1. Override a cell-specific setting like:
cells:
  enabled: true
  instance_count: 3
  instances:
    - config:
        gitlab:
          topology_service:
            ca_file: foo
  1. Inspect gdk.yml of first cell which should have gitlab.topology_service.ca_file = foo overridden.

In this example the main GDK listens on 10.23.0.5.

Impacted categories

The following categories relate to this merge request:

Merge request checklist

  • This change is backward compatible. If not, please include steps to communicate to our users.
  • Tests added for new functionality. If not, please raise an issue to follow-up.
  • Documentation added/updated, if needed.
  • Announcement added, if change is notable.
  • gdk doctor test added, if needed.
  • Add the ~highlight label if this MR should be included in the CHANGELOG.md.
Edited by Peter Leitzen

Merge request reports

Loading