Services
A Service publishes a TCP port through the router. It is a Controller object. It is separate from a microservice. On a Kubernetes control plane, the Controller may also create a Kubernetes Service that forwards to the router pods.
Containers on the same Edgelet node still use bridge names. See DNS and Bridge DNS.
Field tables are on Service fields. Which nodes open the port is on Distribution tags. The connector and listener are on TCP bridge.
The list and the detail panel are Network.
Types
spec.type | Backend | Connector runs on |
|---|---|---|
microservice | application/microservice or a microservice UUID | The Edgelet node that runs that microservice |
agent | Edgelet node name or UUID | That node |
k8s | A DNS name or IP already in the Kubernetes cluster | Default router. Allowed only on a Kubernetes control plane. No extra Kubernetes Service is created. |
external | A DNS name or IP outside the cluster | Default router |
microservice and agent need a router on the backend node. routerMode: none is rejected.
k8s and external require spec.defaultBridge: default-router. Omitting defaultBridge selects that default. For microservice and agent, defaultBridge may instead be the UUID of an upstream router that node already uses.
Tags live on metadata.tags, not under spec.
Remote control plane
Omit servicePort and k8sType. The Controller sets servicePort to the assigned bridgePort. serviceEndpoint is the hub router host.
apiVersion: datasance.com/v3
kind: Service
metadata:
name: checkout
namespace: my-ecn
tags:
- checkout
spec:
type: microservice
resource: orders/checkout
targetPort: 8080
defaultBridge: default-router
Kubernetes control plane
servicePort and k8sType are required for microservice, agent, and external. The Controller creates a Kubernetes Service that forwards servicePort to bridgePort on the router pods.
type: k8s does not create that Kubernetes Service. type: external uses the same servicePort and k8sType as the example below. Set resource to a DNS name or IP outside the cluster.
apiVersion: datasance.com/v3
kind: Service
metadata:
name: checkout
namespace: my-ecn
tags:
- checkout
spec:
type: microservice
resource: orders/checkout
targetPort: 8080
servicePort: 80
k8sType: LoadBalancer
defaultBridge: default-router
Deploy
potctl deploy -f service.yaml -n my-ecn
deploy -f. There is no apply.
Create returns provisioningStatus: pending. potctl waits until the hub is ready or failed. ready means the hub connector, hub listener, and, when required, the Kubernetes Service succeeded. Listeners on tagged Edgelet nodes reconcile separately. After a successful deploy, those listeners may still be converging.
get services shows type, resource, target port, bridge port, and status.
type and defaultBridge cannot be changed. Delete and recreate. bridgePort is assigned once and kept. It is not a field you set in YAML.
Redeploy the same file to change other fields, including metadata.tags. describe service -o yaml adds bridgePort and serviceEndpoint. Remove bridgePort before you deploy that export again.
A microservice on the bridge network of a node that received the listener dials router.default.svc.bridge.local and bridgePort. See Distribution tags.
Put the microservice in the file before the Service that names it. potctl also sorts kinds and deploys Service after Microservice. Set distribution tags on the Edgelet node when that node should listen. See Distribution tags.
CLI
potctl get services -n my-ecn
potctl describe service checkout -n my-ecn
potctl reconcile service checkout -n my-ecn
potctl delete service checkout -n my-ecn
- get services shows live status.
- describe service exports YAML.
- reconcile service retries a failed hub.
- delete service removes the Service.
Delete removes the hub connector and the hub listener. It removes the Kubernetes Service when one was created. It reconciles Edgelet nodes that matched the old tags so those listeners drop.
| Symptom | What to check |
|---|---|
No bridge port, or status failed | Run reconcile service. Read provisioningError. Confirm the backend node has a router. |
| Connection refused | Use the bridge port from get services, on a node whose tags selected the Service. |
| Listener on the wrong nodes | Service metadata.tags against the prefixed tags on each Edgelet node. |
Console
Open Network for the list, the bridge port, and hub status. Edit YAML in the detail panel after the first potctl deploy. See Network.
Related
- Service fields
- Distribution tags
- TCP bridge
- Service interconnection
- Router topology
- Edgelet nodes
- Tutorial: Diagnostic service