Skip to main content

Module services

Module services 

Source
Available on crate feature gateway-api only.
Expand description

The Service rws keeps for each Gateway: the Gateway’s own address (LoadBalancer by default), one port per listener port, each mapped to a container port allocated from a range — the pods tell Gateways apart by the port a connection arrives on, and never bind ports below 1024.

Allocations live in the Services themselves: a listener port keeps its container port for as long as its Service has it, so every replica, and every restart, agrees on the mapping without any other storage.

Structs§

ServiceSettings
How Gateways’ Services are made.

Constants§

ENDPOINTS_MANAGED_BY
endpointslice.kubernetes.io/managed-by on the EndpointSlices rws writes (not the EndpointSlice controller’s value, so it leaves them alone; a label value, so no /).

Functions§

address_supported
Address types rws can ask a load balancer for: IPAddress (the default).
container_ports
(listener port, transport) → container port, as the Gateway’s current Service maps it.
current
The Service rws manages for this Gateway, as it is now.
desired
The Service every one of gateways should have, allocating container ports for new listener ports (keeping every existing allocation).
endpoint_slices
The EndpointSlice of each Gateway Service: the serving pods on the Service’s container ports (one slice per address family in use).
requested_addresses
The static addresses a Gateway asks for (spec.addresses with a value; one with only a type asks for any address).
same
Whether current already is what desired asks for (the fields rws sets; the API server fills in others, like clusterIP and node ports).
same_slice
Whether an EndpointSlice already has what desired asks for.
service_name
The Service’s name for a Gateway: rws-<gateway>, shortened with a hash past the 63 characters a Service name may have.
serving_pods
The serving pods: in the pod namespace, matching selector, with an IP, not being deleted; (IP, ready, node, name).
transport
The transport a listener protocol needs.