Using Test-Driven Development for Kustomize Overlays
I am by no means a developer (not by a long shot!), but I have been learning lots of development-related things over the last several years and trying to incorporate those into my workflows. One of these is the idea of test-driven development (see Wikipedia for a definition and some additional information), in which one writes tests to validate functionality before writing the code to implement said functionality (pardon the paraphrasing). In this post, I’ll discuss how to use conftest to (loosely) implement test-driven development for Kustomize overlays.
If you’re unfamiliar with Kustomize, then this introductory article I wrote will probably be useful.
For the discussion around using the principles of test-driven development for Kustomize overlays, I’ll pull in a recent post I did on creating reusable YAML for installing Kuma. In that post, I pointed out four changes that needed to be made to the output of kumactl install control-plane to make it reusable:
- Remove the
caBundlevalue for all webhooks. - Annotate all webhooks so that cert-manager will inject the correct
caBundlevalue. - Add a volume and volume mount to the “kuma-control-plane” Deployment.
- Change one of the environment variables for the “kuma-control-plane” Deployment to reference the volume added Continue reading











