A testing environment for Kubernetes
Note: Everything mentioned here is also in the Controller Runtime's pkg envtest docs.
- To start up a
local control plane
,envtest
spins up a local instance ofcontrol plane binaries.
These would be,etcd
andkube-apiserver
. It's available as a package undercontroller-runtime
. - Alternatively,
an existing cluster
can be used to runenvtest
, by loading up CRDs and client config. - We'll focus on the
local control plane
implementation instead. It provides a little cluster we can work with for our little test environment, and the lack of things such as a scheduler will allow us to learn more about the kube-apiserver along the way.
Setting up fixtures in envtest