Use

Define a Region

Define a Region via CR:

apiVersion: ext.burningxflame.github.com/v1
kind: Region
metadata:
  namespace: <ns>
  name: <name>
spec:
  # the internal port of XTS for the destination region
  internalPort: <port>
  # the external (i.e. public) address of XTS of the destination region
  externalAddr: <host>:<port>

Define a Region for each destination region.
Usually you define Regions to be referenced by Dsts.

However you don’t access the internalPort of a Region. This is reserved for implementing advanced features in future.

Define a Destination

Define a Destination via CR:

apiVersion: ext.burningxflame.github.com/v1
kind: Dst
metadata:
  namespace: <ns>
  name: <name>
spec:
  # the internal port of XTS for the destination
  internalPort: <port>
  # the destination region
  dstRegion: <ns>/<name>
  # the destination address in the destination region
  dstAddr: <host>:<port>

Define a Dst for each destination.
XTS will listen on internalPort. All traffic to internalPort will be routed to dstAddr in dstRegion.
dstRegion refers to a Region. The format is <namespace>/<name>.

Access a Destination

The experience of accessing services in other regions is like accessing services in the same region.

  1. Connect to a Dst by connecting to <xts-dns-name>:<internalPort>.
    <xts-dns-name> is the DNS name generated by K8S for XTS, and defaults to xts.<namespace>.svc.cluster.local, and can be abbreviated to xts.<namespace>, and can be abbreviated to xts if the service which initiates the connection is deployed in the same namespace as XTS.
    <internalPort> is the internalPort of the Dst.

  2. XTS will establish a secure tunnel between your service and the destination, as if your service is directly connected to the destination.

  3. Proceed to data transmission.

Uniqueness of Port

internalPorts should be unique among all ports of XTS in a K8S cluster, otherwise the CR will be rejected.

RESTful

RESTful API is also available. To learn more, view the RESTful API docs → .