Service Interconnection
kind: Service publishes a TCP port through the router. It is not a microservice and it is not a Kubernetes Service by itself. Controller turns one Service row into:
- A
tcpConnectoron the router that can reach the backend. - A
tcpListeneron the hub router, and on every Edgelet agent whose tags select this service. - When
CONTROL_PLANE=kubernetesand the type ismicroservice,agent, orexternal, a Kubernetes Service inCONTROLLER_NAMESPACEthat forwardsservicePortto that listener.
Create returns immediately with provisioningStatus: pending. Router and Kubernetes updates run in the background. ready means the hub connector, hub listener, and (when required) the Kubernetes Service succeeded. Edge listeners are a separate fog reconcile.
Upload: POST /api/v3/services/yaml and PATCH /api/v3/services/yaml/{name}, multipart field service. On update, metadata.name must equal {name}. apiVersion is not checked. metadata and spec are required. Tags live under metadata.tags, not spec.
type and defaultBridge cannot be changed. Delete and recreate. bridgePort is assigned once and kept.
YAML
Remote control plane (CONTROL_PLANE is not kubernetes). k8sType and servicePort are not used. Controller sets servicePort to the assigned bridgePort and serviceEndpoint to the hub router host.
apiVersion: iofog.org/v3
kind: Service
metadata:
name: checkout
tags:
- checkout # distribution token; matched against agent tags
spec:
type: microservice
resource: orders/checkout # <application>/<microservice>, or a microservice uuid
targetPort: 8080
defaultBridge: default-router
Kubernetes control plane. k8sType and servicePort are required for microservice, agent, and external.
apiVersion: iofog.org/v3
kind: Service
metadata:
name: checkout
tags:
- checkout
# contains ":", so this is a Kubernetes annotation only, not a distribution tag
- "service.beta.kubernetes.io/aws-load-balancer-type: nlb"
spec:
type: microservice
resource: orders/checkout
targetPort: 8080
servicePort: 80
k8sType: LoadBalancer
defaultBridge: default-router
Backend that is already a cluster DNS name (type: k8s). Allowed only when the control plane is Kubernetes. Controller does not create a Kubernetes Service for this type. resource is the host the connector dials.
apiVersion: iofog.org/v3
kind: Service
metadata:
name: payments
tags:
- payments
spec:
type: k8s
resource: payments.payments.svc.cluster.local
targetPort: 8080
defaultBridge: default-router