Skip to main content

Crate fakecloud_k8s

Crate fakecloud_k8s 

Source
Expand description

Shared Kubernetes-backend primitives for FakeCloud.

FakeCloud can run its container-backed services (Lambda, ElastiCache, RDS, ECS) either by shelling out to a local Docker/Podman daemon (the default) or by spawning native Pods in a Kubernetes cluster. The k8s path is the same for every service — connect a client, build a Pod, wait for it to come up, optionally exec into it, tear it down, and reap orphans left by a previous process. This crate holds that common machinery so each service only has to describe its Pod, not re-implement the client bootstrap, readiness polling, exec plumbing, reaping, and DNS-safe naming.

Backend selection (FAKECLOUD_CONTAINER_BACKEND / FAKECLOUD_<SERVICE>_BACKEND) lives in backend. The kube client wrapper and Pod lifecycle live in client. Env parsing (FAKECLOUD_K8S_*) lives in [env]. Operator-configurable Pod scheduling/metadata (node selector, tolerations, annotations) lives in pod_config. Naming + label conventions live in names and labels.

See website/content/docs/guides/kubernetes-backend.md for the operator-facing setup (ServiceAccount, RBAC, Deployment yaml).

Re-exports§

pub use backend::backend_choice;
pub use backend::Backend;
pub use client::ExecOutput;
pub use client::K8sClient;
pub use client::K8sError;
pub use env::K8sEnv;
pub use env::K8sEnvError;
pub use pod_config::K8sPodConfig;
pub use pod_config::K8sPodConfigError;

Modules§

backend
Backend selection: Docker (default) vs native Kubernetes Pods.
client
Kube client wrapper + generic Pod lifecycle shared by every backend.
env
Parsing of the FAKECLOUD_K8S_* operator configuration.
labels
Pod label conventions shared by every FakeCloud k8s backend.
names
DNS-1123-safe naming helpers shared by every FakeCloud k8s backend.
pod_config
Operator-configurable Pod scheduling + metadata shared by every FakeCloud k8s backend.