Skip to content

Concepts ​

The pieces ​

PieceRuns asDoes
Application nameA Service named after the SiteService, with no selectorThe name the application connects to. Strait writes its endpoints: the member's pods, the local gateway, or nothing.
strait-controllerDeployment, one per siteRuns the plugins on local members, reads the peers' observations, decides the route, writes the endpoints, and configures the gateway over xDS.
PluginInside the controllerReads a workload's state, read-only: cnpg or declared.
Observation exchangeHTTP GET over the linkEach site publishes what it observes about its own members, and each peer polls it. No site holds credentials to another site's API.
strait-gatewayDeployment per site, one active replicaEnvoy carries TCP between sites. An agent next to it holds the WireGuard interfaces and reports link health.
LinkOne SiteLink per path to a peerA transport, direct or wireguard, and a cost. The healthy link with the lowest cost carries the traffic.
straitCLI on the operator's machineShows and explains the state of one site. Read-only.

Each site has one Site, one SitePeer per peer and one SiteLink per path. Every resource is listed in Resources and chart values.

A SiteService ​

Apply the same object at every site:

yaml
apiVersion: strait.tako.id/v1
kind: SiteService
metadata:
  name: pg
  namespace: app
spec:
  mode: Single
  port:
    name: postgres
    port: 5432
  plugin:
    cnpg:
      role: primary
  members:
    - name: pg-a
      site: a
      cnpg:
        cluster: pg-a
    - name: pg-b
      site: b
      cnpg:
        cluster: pg-b
  policy:
    unknownHold: 30s

Applications at both sites connect to pg.app.svc:5432. Each site's controller writes that Service's endpoints: the primary's pods when it is local, the local gateway when it is remote, and nothing when it can't tell which member is writable.

Routes nowhere rather than to a guess ​

When Strait can't tell which member is active, the name has no endpoints. A new connection is refused at once, and the client retries. The name routes nowhere when two members are writable, when sites declare different primaries, or when a member stays Unknown for too long. See RFC0002.

Observes, never acts ​

Plugins get read-only permissions and no workload credentials. Strait never promotes, demotes, fences or reconfigures a workload. See RFC0003 and RFC0007.

Modes ​

ModeRoutes to
SingleThe one writable member, such as a database primary.
SetEvery eligible member, such as read replicas, filtered by locality: LocalFirst, LocalOnly or Any.

See RFC0002.

Plugins ​

PluginReads
cnpgCloudNativePG Clusters, and a Pooler when named.
declaredNothing: the active member comes from the spec, for a workload that no plugin observes.

See RFC0003.

TransportIs
directA private path with no tunnel, declared encryption: None.
wireguardA kernel WireGuard tunnel between the gateways.

When the active link fails, new connections move to the next one within 5 seconds. See RFC0005.

Endpoint-direct ​

On a direct link where pod addresses are routable between sites, the name points straight at the remote pods, with no gateway hop. In production, set the link's endpointCIDRs to the peer's pod CIDRs, so that a peer's document can't point the name at another address. See RFC0005 and the Gateway benchmark.

Envoy over xDS ​

The controller configures Envoy with no reload. A route change never closes an established connection, unless the SiteService asks for it with policy.connections: EndGateway. See RFC0005 and RFC0002.

Released under the Apache License 2.0.