Categorygithub.com/nickschuch/controller-runtime-envtest-k3s
modulepackage
0.0.0-20190417232657-f5d52674d481
Repository: https://github.com/nickschuch/controller-runtime-envtest-k3s.git
Documentation: pkg.go.dev

# README

controller-runtime-envtest-k3s

A drop in replacement for https://sigs.k8s.io/controller-runtime/pkg/envtest using https://k3s.io

Why?

  • sigs.k8s.io/controller-runtime/pkg/envtest uses process execution under the hood to run clusters. This uses containers to wrap those processes!
  • Lesss CPU and Memory overhead
  • Provides a full Kubernetes environment for full end-to-end tests (eg. Nodes provided)
  • Easier to debug fails eg. Get a session on the clusters container

Usage

The following example is taking an autogenerated test suite from the Kubebuilder project and converting it to use K3s as it's test Kubernetes cluster.

Can you spot the difference? :)

BeforeAfter
beforeafter

Thankyou

This project is standing on the shoulders of giants.

  • K3s - Amazing project which makes it super easy to spin up Kubernetes environments.
  • envtest - We are still using this under the hood for some of the heavily lifting eg. Installing CRDs.

# Constants

BindAddress assigned to the K3s cluster.
DefaultImage which will be used if non is provided.
InsecurePort assigned to the K3s cluster.

# Structs

Environment which will back the Kubebuilder testsuite.