cert-manager/devel
James Munnelly 5d02930e38 Allow setting FEATURE_GATES in devel/addon/certmanager/install.sh
Signed-off-by: James Munnelly <james@munnelly.eu>
2020-04-15 12:27:15 +01:00
..
addon Allow setting FEATURE_GATES in devel/addon/certmanager/install.sh 2020-04-15 12:27:15 +01:00
bin Fixup using devel tools in CI 2020-01-23 12:57:03 +00:00
cluster devel: add k8s 1.18 support 2020-03-25 23:36:00 +00:00
lib Use legacy CRD manifests when running end-to-end tests against Kubernetes 1.14 and below 2020-03-06 15:32:17 +00:00
BUILD.bazel Use bind are rfc2136 server for DNS01 challenges 2020-03-07 00:13:07 +00:00
ci-run-e2e.sh Trap exporting logs in run e2e test _before_ cluster create 2020-04-01 18:54:33 +01:00
README.md Create devel directory and use it for e2e tests 2020-01-22 22:08:27 +00:00
run-e2e.sh Fixup using devel tools in CI 2020-01-23 12:57:03 +00:00
setup-e2e-deps.sh e2e: install addons in parallel 2020-03-07 00:13:07 +00:00

Development tooling

This directory contains tools and scripts used to create development and testing environments for cert-manager.

Tool dependencies

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"

Common usages

This section describes common usage patterns for development and testing.

Creating a kind cluster

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.

Installing a development build of cert-manager

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.

Running end-to-end tests

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.

Deleting the test cluster

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]