liveBook · Manning

Service

As explained in Shipping Go: Develop, deliver, discuss, design, and go again

A software component that provides functionality to other components through a defined interaction boundary.

A service provides functionality through a defined interaction boundary. In application code, that boundary may select a remote implementation from configuration; in Kubernetes, it routes calls to running containers. section 8.3.2 section 10.3

Two practical forms appear in the delivery workflow:

  • An external service is reached through a configured URL. An interface lets the application swap a static client for a remote client without changing the handler. section 8.3.2
  • A Kubernetes Service creates an endpoint for a Deployment, forwarding traffic to container instances and optionally distributing calls like a load balancer. section 10.3

Routing hello-api

A Service selects pods labeled app: hello-api, exposes port 80, and forwards TCP traffic to the application on targetPort 8080. A LoadBalancer type can distribute calls across instances. section 10.3

How Shipping Go: Develop, deliver, discuss, design, and go again covers it

How deep it goes
Defines endpoint routing and load-balancing behavior, but defers deeper Kubernetes mechanics.
Examples
Uses a remote translation client, hello-api, and Kubernetes Service YAML targeting port 8080.
What it assumes
Assumes interfaces and dependency injection when selecting between static and remote clients.
What you can do after
Operate/configure services through endpoint settings and Kubernetes Service YAML.
How it connects
Links interfaces, dependency injection, clients, deployments, pods, containers, configuration, and secrets.

Also explained in

Compare how 2 books explain service →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Shipping Go: Develop, deliver, discuss, design, and go again. The section links point to the parts of the book it draws on.