Skip to main content
Version: v1.4.8

Service YAML Specification

A Service in Datasance PoT enables you to expose microservices, agents, Kubernetes services, or external endpoints through the Router's TCP bridge mechanism. Services create TCP connectors on Router instances, allowing microservices to reach these endpoints via a service mesh.

Service Definition

---
apiVersion: datasance.com/v3
kind: Service
metadata:
name: test-service
tags:
- test
- 'service.beta.kubernetes.io/aws-load-balancer-scheme: internal'
spec:
type: microservice # agent, external, k8s
resource: 4f783572-c5fc-4e84-85cd-a21cde5ab5ec
targetPort: 1880
defaultBridge: default-router
# k8sType: LoadBalancer
# servicePort: 1880

Field Specifications

FieldDescription
metadata.nameUnique name for the service
metadata.tagsService tags used for service distribution within the cluster and Kubernetes service annotations
spec.typeType of endpoint that the Router instance creates a TCP connector for. Valid values: microservice, agent, k8s, or external
spec.resourceResource identifier based on the service type:
- For microservice: appName/microserviceName or microservice UUID
- For agent: agentName or agent UUID
- For k8s: Kubernetes FQDN
- For external: URL endpoint
spec.targetPortTarget port of the resource to connect to
spec.defaultBridgeName of the Router instance where the service bridge will be created (e.g., default-router)
spec.k8sType(Optional) Kubernetes service type when ControlPlane is Kubernetes. Valid values: LoadBalancer, ClusterIP, etc.
spec.servicePort(Optional) Kubernetes service port when ControlPlane is Kubernetes

Viewing Services

Once you deploy a service, you can check the Bridge Port assigned to the service, which is the TCP listener port on the Router.

potctl get services
NAMESPACE
default

SERVICE TYPE RESOURCE TARGET PORT BRIDGE PORT STATUS
test microservice 4f783572-c5fc-4e84-85cd-a21cde5ab5ec 1883 10024 ready

Service Distribution

Services are distributed to Agents based on tags. In the above example, the created service has the test tag. Any Agent with the 'service.datasance.com/tag: test' annotation will have the proper Router TCP listener configuration, allowing microservices running on that host to reach this service via service.local:$bridgePort.

Example: Agent Configuration with Service Tag

apiVersion: datasance.com/v3
kind: AgentConfig
metadata:
name: edge-1
tags:
- 'service.datasance.com/tag: test'
spec:
...

Example: Agent with Service Tag

apiVersion: datasance.com/v3
kind: Agent
metadata:
name: edge-1
tags:
- 'service.datasance.com/tag: test'
spec:
...
Group 3See anything wrong with the document? Help us improve it!