Skip to main content

Module spec

Module spec 

Source
Expand description

Pod spec construction for the Kubernetes super::K8sBackend.

Pure functions over k8s_openapi::api::core::v1::Pod — no cluster interaction, fully unit-testable.

Structs§

PodSpecContext
Inputs that don’t come from the function itself — instance identity, the in-cluster fakecloud URL, the bearer token the init container uses to fetch code/layers, etc.

Functions§

build_pod_spec
Build the Pod spec for a single Lambda function invocation runtime. The Pod has one init container (busybox) that downloads code + layers from fakecloud over HTTP, and one main container running the AWS RIE image (zip functions) or the user-supplied image (image functions).
pod_name_for
Build a deterministic, DNS-1123-safe Pod name for the given function + deploy_id. Truncated/lowercased so it fits the 63-char label limit. The suffix is a stable hash of deploy_id so a new deploy gets a fresh, non-colliding Pod name.
unique_pod_name
Build a per-launch unique DNS-1123-safe Pod name. The deterministic pod_name_for name collides whenever the warm pool needs more than one concurrent instance of a function (the RIE serves one invocation at a time), and a still-terminating Pod blocks its replacement (AlreadyExists / “object is being deleted” / NotFound races). Salting the hashed id with a process-monotonic counter yields a fresh, length-bounded name per launch, so instances never collide and a dying Pod never wedges a new one.