This directory contains tools and scripts used to create development and testing environments for cert-manager.
The scripts in this directory commonly require additional tooling, such as
access to kubectl
, helm
, kind
and a bunch of other things.
If you already have these tools available on your host system, the scripts should just work, so long as the versions you have installed are roughly compatible.
If you are running into issues with your host-installed tools, Bazel provides versioned access to all of the required tools for the e3e scripts.
To setup your shell to use the Bazel provided versions of these tools, run the following from the root of the repository:
export PATH="$(pwd)/devel/bin:$PATH"
This section describes common usage patterns for development and testing.
To create a kind cluster that can be used for both development and testing, run
./devel/cluster/create.sh
from the root of the cert-manager repository:
./devel/cluster/create.sh
You can change the name of the kind cluster created by setting:
export KIND_CLUSTER_NAME=custom-cluster-name
If a cluster with the same name already exists, it will not be recreated and instead will be reused.
Once you have a kind cluster running, you can install a development version of cert-manager by running:
./devel/addon/certmanager/install.sh
This will build, load and install cert-manager from source into your kind development cluster.
Further invocations of the install.sh
script will rebuild and upgrade the
installed version of cert-manager, making it possible to iteratively work on
the codebase and test changes.
Before running the end-to-end tests, you must install some additional components used during the tests into your kind cluster.
Run the following to setup persistent test instances of Pebble, ingress-nginx, and a sample DNS01 webhook:
./devel/setup-e2e-deps.sh
You only need to run this command once for the lifetime of your test cluster.
If you haven't already, deploy a new test build of cert-manager:
./devel/addon/certmanager/install.sh
Finally, run the end-to-test tests using:
./devel/run-e2e.sh
You can run this command multiple times against the same cluster without adverse effects.
Once you have finished with your testing environment, or if you have
encountered a strange state you cannot recover from, you can tear down the
testing environment by using kind
directly:
kind delete cluster [--name=$KIND_CLUSTER_NAME]