Developer

Uses: Kong Mesh

The developer is a senior software engineer on the Passenger Experience team at Kong Air. The developer owns the services that passengers interact with:

  • passenger-portal: the booking and check-in UI
  • check-in-api: the back end that assigns seats and issues boarding passes

Other teams own the operational core (flight-control) and the baggage service (baggage-api), and the operator registers the external dependencies. The developer’s job is to release their own services safely, make them resilient, and call the services of other teams.

What the developer owns at Kong Air

flowchart LR
  subgraph DEV["The developer's scope"]
    PP["passenger-portal"]
    CI["check-in-api"]
  end
  subgraph OTHERS["Owned by other teams"]
    FC["flight-control<br/>(the operator)"]
    BAG["baggage-api<br/>(zone2)"]
    AP["aeropay-api<br/>(AeroPay)"]
  end

  FC --> CI
  CI --> PP
  PP --> BAG
  PP -.-> AP

The dashed arrow points to AeroPay, Kong Air’s payment provider, which runs outside the mesh. For the full picture, see Kong Air.

How the developer calls the services of other teams

The developer’s services call each destination by a hostname. The developer doesn’t manage the resources behind these hostnames:

Destination

Hostname the developer calls

Where it comes from

check-in-api, in the same zone check-in-api.kong-air-production.svc.cluster.local The Kubernetes Service. The sidecar proxies the traffic like any other mesh traffic.
baggage-api, in zone2 baggage-api.kong-air-production.svc.zone2.mesh.local The MeshService that zone2 generates and the global control plane syncs to zone1. See Send traffic between zones.
AeroPay, outside the mesh aeropay-api.extsvc.mesh.local The MeshExternalService that the operator registers. See Manage external services with MeshExternalService.

A hostname doesn’t grant access. Each call also needs a MeshTrafficPermission that the security architect manages.

How the developer releases a new version

To release passenger-portal v2, the developer gives each version its own MeshService, and applies a MeshHTTPRoute that sends 90% of the traffic to v1 and 10% to v2. The developer then checks the new version before sending it more traffic. See Split traffic with MeshService resources.

How the developer makes services resilient

Retries with MeshRetry

A new mesh doesn’t retry failed requests. The developer wants every caller of check-in-api to retry requests that fail with a 5xx status. The developer creates the MeshRetry in the namespace of check-in-api and selects it as the destination, which makes it a producer policy that reaches every caller. See Target workloads and services.

Calls to AeroPay also get retries: a MeshRetry makes the passenger-portal sidecar retry failed calls to aeropay-api up to three times. See Manage external services with MeshExternalService.

Test failures with MeshFaultInjection

The developer checks how callers handle a failing check-in-api. A MeshFaultInjection makes the check-in-api sidecar return errors, add latency, or slow its responses to flight-control, without changing the application. See Validate resilience with fault injection.

How the developer observes services

The operator collects the metrics and access logs of every sidecar. The developer reads them in the Workload Health and Workload Debug Grafana dashboards, and reads the access log of a sidecar to see why a call failed, for example a 403 from a missing permission. See Observe mesh traffic in practice.

How the developer declares what each service calls

Before the mesh carries production traffic, each workload declares the destinations it calls in the kuma.io/reachable-backends annotation. For example, passenger-portal declares check-in-api, baggage-api in zone2, and aeropay-api. Each proxy then receives configuration only for these destinations, and can’t reach anything else after the operator turns on restrictOutbound. See Prepare the mesh for production.

With these policies, the developer spends less time on the network and more time on features for passengers.

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!