Crate k8s_test_framework

Source
Expand description

Kubernetes test framework.

The main goal of the design of this test framework is to wire kubernetes components testing through the same tools that are available to the developer as executable commands, rather than using a rust interface to talk to k8s cluster directly. This enables very trivial troubleshooting and allows us to use the same deployment mechanisms that we use for production - effectively giving us the opportunity to test e2e: not just the code layer, but also the deployment configuration.

Re-exports§

pub use framework::Framework;
pub use interface::Interface;
pub use test_pod::CommandBuilder;

Modules§

framework
The test framework main entry point.
interface
An interface into the system.
kubernetes_version
Perform a version lookup.
namespace
Manage namespaces.
restart_rollout
Restart a resource rollout.
test_pod
Manage test pods.
vector
Manage Vector.
wait_for_resource
Wait for a resource to reach a certain condition.
wait_for_rollout
Wait for a resource rollout to complete.

Structs§

Manager
Manages commands for bringing up and shutting down resources on the cluster.
PortForwarder
Keeps track of the continuously running kubectl port-forward command, exposing the API to terminate it when needed.
Reader
Keeps track of the command invocation, proving the interface to read the output and send a termination signal.

Functions§

lock
A shared lock to use commonly among the tests. The goal is to guarantee that only one test is executing concurrently, since tests use a shared resource - a k8s cluster - and will conflict with each other unless they’re executing sequentially.