To spin up a local testing kind cluster (1 master node, 2 workers), you can run
kind create cluster --config hack/kind-config.yaml --image=kindest/node:v1.22.0
You can use --image flag to specify the cluster version you want, e.g. --image=kindest/node:v1.17.2, the supported version are listed here
if you need to remove any leftovers, just run
kubectl get ns -o name | grep ctrl-test | xargs kubectl delete
In order to test our webhook implementation, sadly we need to have a support of cert-manager
kubectl config set-context kind-gitlab-runner-cluster
kubectl apply -f https://github.com/jetstack/cert-manager/releases/latest/download/cert-manager.yaml
Install crd to the cluster
make install
Note: you need to specify an image name during the build. If the image has latest
tag, then kind will attempt to download
it even if you have loaded it through kind load docker-image
make docker-build controller:dev
kind load docker-image controller:dev --name gitlab-runner-cluster
make deploy IMG=controller:dev