Documentation
¶
Overview ¶
Package published chooses the Published ports (ADR 0012) a Containerized Instance serves host clients on: the ports its own container publishes to the host. GKE LoadBalancer Services (on a VM runtime) and forwarding rules (on any runtime) share them, and whoever binds a port first wins.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Candidates ¶
Candidates lists the container ports to try serving port on, in order: port itself when the container publishes it at the same host port, then the published ports of --port-range lo-hi (when ranged), from a hash of name onwards, so that name keeps its port across syncs and restarts where it can. published maps each published container port to its host address (runtime.Client.SelfPorts).
func Hint ¶
Hint says what to publish so that port, the port of what ("the Service", "the forwarding rule"), can be served, given the Instance's --port-range ("" for none).
func ListenShared ¶
ListenShared listens on addr like net.Listen, but lets a listener on the wildcard address and one on a specific address share a port (Linux refuses that otherwise), when both are opened with it. A forwarding rule's loopback listener and a Published port listener on the rule's own port need that in a Containerized Instance. Sharing also lets two wildcard listeners share a port, so callers must keep track of the ports they hold themselves; a plain listener (another process, or a GKE LoadBalancer Service) still refuses it.
Types ¶
This section is empty.