Skip to main content

Limitations

One Kubernetes version per test binary​

The API server runs the version your k8s.io/client-go targets. petri cannot test version skew; see compatibility.

Pods run only on a dedicated plane's Nodes​

On the shared plane, or on any plane without Nodes, Pods stay Pending, and the workload controllers stop where they need a running Pod; see built-in controllers. A namespace that held Pods can then stay Terminating, because no kubelet confirms that the Pods are gone. Upstream behaves the same way.

Simulated Nodes run no containers​

There are no probes, images, volumes, resource usage or restarts, and readiness gates are ignored. Pods stay Running until the test finishes them. Nodes send no heartbeats and have no Leases, and there is no taint-based eviction.

Some controllers are not available​

Out of scope: node lifecycle and IPAM, volumes (PersistentVolume binding, attach and detach, expansion), the horizontal Pod autoscaler, cloud controllers, certificate signing and bootstrap tokens.

CronJobs follow the wall clock​

Upstream has no way to inject a clock. To test the Job a CronJob would create, create it from the CronJob's spec.jobTemplate.

Logging is redirected for the whole process​

petri captures klog and logrus output, so it also captures your code's output if your code logs through them. PETRI_VERBOSE=1 prints it.

Storage is kine, not etcd​

kine's in-memory driver behaves like etcd for everything kube-apiserver does. etcd-specific edge cases, such as compaction timing, may differ.

The shared plane and EnableControllers need a testing.TB​

Frameworks without a testing.TB cannot use them. Ginkgo can, through GinkgoTB(); see Ginkgo and other frameworks.