fakecloud_k8s/lib.rs
1//! Shared Kubernetes-backend primitives for FakeCloud.
2//!
3//! FakeCloud can run its container-backed services (Lambda, ElastiCache,
4//! RDS, ECS) either by shelling out to a local Docker/Podman daemon (the
5//! default) or by spawning native Pods in a Kubernetes cluster. The k8s
6//! path is the same for every service — connect a client, build a Pod,
7//! wait for it to come up, optionally `exec` into it, tear it down, and
8//! reap orphans left by a previous process. This crate holds that common
9//! machinery so each service only has to describe *its* Pod, not
10//! re-implement the client bootstrap, readiness polling, exec plumbing,
11//! reaping, and DNS-safe naming.
12//!
13//! Backend selection (`FAKECLOUD_CONTAINER_BACKEND` /
14//! `FAKECLOUD_<SERVICE>_BACKEND`) lives in [`backend`]. The kube client
15//! wrapper and Pod lifecycle live in [`client`]. Env parsing
16//! (`FAKECLOUD_K8S_*`) lives in [`env`]. Operator-configurable Pod
17//! scheduling/metadata (node selector, tolerations, annotations) lives in
18//! [`pod_config`]. Naming + label conventions live in [`names`] and
19//! [`labels`].
20//!
21//! See `website/content/docs/guides/kubernetes-backend.md` for the
22//! operator-facing setup (ServiceAccount, RBAC, Deployment yaml).
23
24pub mod backend;
25pub mod client;
26pub mod env;
27pub mod labels;
28pub mod names;
29pub mod pod_config;
30
31pub use backend::{backend_choice, Backend};
32pub use client::{ExecOutput, K8sClient, K8sError};
33pub use env::{K8sEnv, K8sEnvError};
34pub use pod_config::{K8sPodConfig, K8sPodConfigError};