Diagnostic service
Goal
Create kind: Service for diagnostic-service. The microservice is already deployed in production monitoring. It listens on external port 8081 and does not use NATS.
The dashboard on ops-b calls this bridge. The next page copies bridgePort into DIAGNOSTIC_URL.
The file is deploy/steps/05-service-diagnostic.yaml.
YAML
diagnostic-service
apiVersion: datasance.com/v3
kind: Service
metadata:
name: diagnostic-service
tags:
- pot-edge-patterns
spec:
type: microservice
resource: production-monitoring/diagnostic-service
targetPort: 8081
defaultBridge: default-router
| Field | Value |
|---|---|
resource | production-monitoring/diagnostic-service |
targetPort | 8081 (Edgelet external port, not container port 8080) |
defaultBridge | default-router |
tags | pot-edge-patterns |
Tag ops-b with service.iofog.org/tag: pot-edge-patterns so that node opens the listener. See Distribution tags.
Deploy
potctl deploy -f deploy/steps/05-service-diagnostic.yaml
What you should see
potctl describe service diagnostic-service
The output includes bridgePort. Copy it on the next page. resource is production-monitoring/diagnostic-service.
Common mistakes
The Service is created before diagnostic-service is deployed.
targetPort is 8080. Use 8081.
ops-b has no pot-edge-patterns tag, so the dashboard call times out.
Next
See anything wrong with the document? Help us improve it!