Skip to content

Onboard a tenant cell to Org Mover

This runbook connects a new dedicated tenant cell (for example a cellsdev cell on AWS) to the Org Mover control plane, so the pilot can move organizations to and from it.

The control plane runs on the org-mover-gstg GKE cluster. A dedicated cell talks to it in two directions:

DirectionPathConfigured in
Cell to control planeThe cell’s producer and consumer dial the NATS data broker on the public nats-data-public Envoy Gateway (34.23.135.213:4222). The Gateway only accepts the source IPs in its allowlist.org-mover-envoy ingress values
Control plane to cellThe pilot dials the cell’s producer (9101) and consumer (9102) through a per-cell internal Envoy egress Gateway, which originates TLS to the cell’s public NLB.org-mover-envoy egress values, org-mover cell roster

All changes live in gitlab-com/gl-infra/argocd/apps:

  • services/org-mover-envoy/env/org-mover-gstg/clusters/org-mover-gstg/app.yaml: ingress allowlist and egress cells
  • services/org-mover/env/org-mover-gstg/clusters/org-mover-gstg/values.yaml: cell roster (cells:)

This runbook covers gstg. gprd follows the same shape once org-mover-envoy is enabled there.

Collect the following before you start:

  • Tenant cell ID, for example c01m3bt2200d4t5bqf. It is used in hostnames and object names.

  • Numeric cellId, the cell.id of the cell’s GitLab as the Topology Service registers it, for example 9. The pilot addresses each org_mover API token to it.

  • Tenant endpoints. The cell’s producer and consumer must be deployed and reachable at org-mover-producer.cell-<cell-id>.gitlab-cells.dev:9101 and org-mover-consumer.cell-<cell-id>.gitlab-cells.dev:9102, behind an NLB that terminates TLS with a public ACM certificate for those names. The egress Gateway validates the certificate against the hostname.

  • Pilot API key. The cell’s GitLab must list the public half of the pilot’s org_mover API key in org_mover.public_key_files.

  • NAT egress IPs of the cell, one per AZ. From the cell’s AWS account:

    Terminal window
    aws ec2 describe-nat-gateways --region us-east-1 \
    --query 'NatGateways[?State==`available`].[NatGatewayId,NatGatewayAddresses[0].PublicIp]'

Check the tenant endpoints resolve and serve a valid certificate:

Terminal window
for svc in producer:9101 consumer:9102; do
host="org-mover-${svc%%:*}.cell-<cell-id>.gitlab-cells.dev"
openssl s_client -connect "${host}:${svc##*:}" -servername "$host" -verify_return_error </dev/null 2>&1 \
| grep -E 'subject=|Verify return code'
done

Both must print Verify return code: 0 (ok).

Make all three changes in one MR, titled for example feat(org-mover): onboard cell <cell-id> (cell <cellId>) in gstg.

Ingress allowlist. Add the cell’s NAT IPs to loadBalancerSourceRanges in the org-mover-envoy app.yaml. Keep the entries of the other cells:

ingress:
loadBalancerSourceRanges:
# cell <cell-id> (cell <cellId>)
- 203.0.113.10/32 # nat-xxxxxxxxxxxxxxxxx
- 203.0.113.11/32 # nat-yyyyyyyyyyyyyyyyy

Egress cell. Add the cell under egress.cells in the same file. Each entry renders its own Gateway, EnvoyProxy, Backends, BackendTLSPolicies and TCPRoutes, and a ClusterIP Service named tenant-egress-<cell-id>:

egress:
cells:
<cell-id>:
consumer:
hostname: org-mover-consumer.cell-<cell-id>.gitlab-cells.dev
port: 9102
producer:
hostname: org-mover-producer.cell-<cell-id>.gitlab-cells.dev
port: 9101

Cell roster. Add the cell to cells: in the org-mover values.yaml, pointing at its egress Service:

cells:
- name: cell-<cell-id>
producerAddr: tenant-egress-<cell-id>.envoy-gateway-system.svc.cluster.local:9101
consumerAddr: tenant-egress-<cell-id>.envoy-gateway-system.svc.cluster.local:9102
cellId: <cellId>

Wait for the argocd-diff-preview comment on the MR before merging. It must show only:

  • the new loadBalancerSourceRanges entries on the nats-data-public EnvoyProxy
  • a new set of tenant-egress-<cell-id> egress objects in envoy-gateway-system
  • the new roster entry in the org-mover ConfigMap

Both Applications use RollingSync and normally sync on their own a few minutes after the merge. Sync in this order, so the roster never points at an egress Service that does not exist yet:

  1. org-mover-envoy on org-mover-gstg
  2. org-mover on org-mover-gstg

If an Application stays OutOfSync, Refresh and Sync it in the ArgoCD UI, or:

Terminal window
argocd app list | grep -E 'org-mover(-envoy)?'
argocd app sync <app-name>
  1. Egress Service exists:

    Terminal window
    kubectl -n envoy-gateway-system get svc tenant-egress-<cell-id>
  2. Ingress allowlist applied. The Service of the nats-data-public Gateway lists the new IPs:

    Terminal window
    kubectl -n envoy-gateway-system get svc \
    -l gateway.envoyproxy.io/owning-gateway-name=nats-data-public \
    -o jsonpath='{.items[0].spec.loadBalancerSourceRanges}'

    GCP updates the LoadBalancer firewall rule a minute or two after the Service changes.

  3. Cell reaches NATS. From a pod or host in the tenant cell:

    Terminal window
    nc -vz 34.23.135.213 4222

    A timeout means the firewall drops the cell’s traffic: check the NAT IPs again.

  4. Egress listener is up. From org-mover-gstg:

    Terminal window
    kubectl -n org-mover run egress-check --rm -i --restart=Never --image=busybox -- sh -c '
    for port in 9101 9102; do
    if timeout 5 nc tenant-egress-<cell-id>.envoy-gateway-system.svc.cluster.local "$port" </dev/null; then
    echo "$port open"
    else
    echo "$port FAILED"
    fi
    done'

    This only proves the egress Service and its Envoy listeners accept connections. Envoy accepts the connection before it dials the cell’s NLB, so it passes even when the TLS handshake to the cell fails.

  5. Egress reaches the cell. Read the upstream stats of the cell’s egress Envoy, after the check above or after the pilot has dialed the cell:

    Terminal window
    pod=$(kubectl -n envoy-gateway-system get pod \
    -l gateway.envoyproxy.io/owning-gateway-name=tenant-egress-<cell-id> -o name | head -1)
    kubectl -n envoy-gateway-system port-forward "$pod" 19001:19001 >/dev/null &
    pf_pid=$!
    sleep 2
    curl -sSf localhost:19001/stats/prometheus \
    | grep -E 'envoy_cluster_(upstream_cx_connect_fail|upstream_cx_total|ssl_connection_error|ssl_fail_verify)' \
    | grep tcproute
    kill "$pf_pid"

    If curl reports a connection error, the tunnel was not ready yet: run the commands again. Empty output with no error means the filter matched nothing, not that there are no failures.

    upstream_cx_total must grow while upstream_cx_connect_fail, ssl_connection_error and the ssl_fail_verify_* counters stay at zero. A growing ssl_* counter means the cell’s certificate does not match its hostname or is not publicly trusted: rerun the openssl s_client check from the prerequisites.

  6. Org Mover sees the cell. The cell shows up as healthy in the Org Mover GUI at https://orgmover.gstg.gitlab.net. This is the end-to-end check for both directions.

  • The cell’s NATS client is stuck in failed / reconnecting. The cell’s NAT IPs are not in the ingress allowlist. This happens when the cell is rebuilt: its NAT gateways, and so its public IPs, are recreated. Run the describe-nat-gateways command again and replace that cell’s entries in loadBalancerSourceRanges.

  • The Service of nats-data-public still has the old ranges after the merge. Check the EnvoyProxy first:

    Terminal window
    kubectl -n envoy-gateway-system get envoyproxy nats-data-public \
    -o jsonpath='{.spec.provider.kubernetes.envoyService.loadBalancerSourceRanges}'

    If it still has the old ranges, ArgoCD has not synced org-mover-envoy: sync it. If it has the new ranges, check the Envoy Gateway controller with kubectl -n envoy-gateway-system logs deploy/envoy-gateway --since=30m.

  • No Service for a Gateway. Run kubectl -n envoy-gateway-system get svc -o wide and kubectl -n envoy-gateway-system get gateway. If the Gateway or EnvoyProxy is missing, ArgoCD pruned it or never applied it: check argocd app get <app-name>. If both exist, check the Envoy Gateway controller logs.

  • The pilot cannot reach the cell’s producer or consumer. Check the egress Gateway status with kubectl -n envoy-gateway-system get gateway tenant-egress-<cell-id> -o yaml | yq '.status', and rerun the openssl s_client check from the prerequisites. A certificate that does not match the hostname fails the TLS handshake on the egress side.

Reverse the procedure: remove the cell from the org-mover roster first and sync org-mover, then remove its egress.cells entry and its NAT IPs from org-mover-envoy and sync it with prune, so its egress objects are deleted. Make sure no move involves the cell before you start.

  • Org Mover: #g_transport Slack channel.
  • ArgoCD and the argocd/apps repository: #g_fleet_management Slack channel.