Skip to content

Endpoint resolution

Nothing about reaching the control plane is discovered. Every caller resolves an address from configuration it was given, and a caller without one fails rather than guessing at a local service. This page is how each caller resolves it.

There are two callers with different addresses, and conflating them is the most common day-0 mistake.

flowchart LR
  CLI["CLI and automation<br/>outside the cluster"] -->|"profile endpoint<br/>usually a forwarded port"| API["Control-plane Service<br/>port 8080"]
  NODE["Data plane node<br/>inside a cluster"] -->|"control_plane.base_url<br/>in-cluster service DNS"| API

How the CLI resolves its endpoint

The CLI reads a config document, selects the active profile, and takes that profile's endpoint. Two per-command flags override it:

--server    overrides the endpoint for this command
--token     overrides the bearer token for this command

The precedence is exactly two levels deep. A --server value wins if present, otherwise the active profile's endpoint is used, otherwise http://localhost:8080 as a last-resort default.

That default is why a misconfigured CLI reports a connection refused against localhost rather than telling you no endpoint is set.

The token follows the same shape: --token if present, otherwise the active profile's token. It is sent as a bearer credential:

authorization: Bearer <token>
accept: application/json
content-type: application/json     (only when the request carries a body)

Requests time out after 60 seconds.

Where the config document lives

~/.xratu/config.json

Set XRATU_CLI_CONFIG to relocate it. The value is expanded and resolved, so a relative path or ~ works.

Environment variables seed the first profile

Four environment variables are read only when the config document is first created, to populate the default profile:

Variable Seeds
XRATU_CP_ENDPOINT The default profile's endpoint
XRATU_CP_TOKEN Its token
XRATU_CP_ORGANIZATION Its organization_uuid
XRATU_CP_WORKSPACE Its workspace_uuid

Once the file exists, changing these has no effect on command routing. The active profile is what is used. If you export XRATU_CP_ENDPOINT and commands still go somewhere else, the profile is the reason, and xratu config view shows where it is pointing.

How a node resolves its endpoint

A data plane node does not use your CLI config. It is configured with a control_plane.base_url in its bootstrap document, and that address must be reachable from inside the cluster the node runs in, which is normally the service DNS name:

http://xratu-control-plane.xratu-cp.svc.cluster.local:8080

When an installation is prepared, that value is resolved in a documented order:

  1. the --control-plane-base-url flag,
  2. the CP_ENDPOINT environment variable,
  3. the XRATU_CP_ENDPOINT environment variable,
  4. the active CLI profile's endpoint.

The fourth step is the trap. If you have a forwarded port in your profile and prepare an installation without setting anything else, the nodes are configured to reach the control plane at an address that only exists on your workstation. Set CP_ENDPOINT to the in-cluster address before preparing, or pass the flag.

Why every address is configured

An address that a component can discover is an address an attacker can influence. Every link in Xratu is a configured endpoint plus a verified identity, so a component that cannot resolve its peer stops rather than falling back to something reachable. See Component topology.