Developer Getting Started
April 27, 2026 ยท View on GitHub
Setting Up a Local Development Environment
By following the steps for externally running a controller or
running the controller inside a KinD cluster, you can set up
a local environment to test your contributions before submitting a pull request.
Running the controller external to the cluster
To test and run the project with your local changes, follow these steps to set up a development environment:
-
Install Dependencies: Ensure you have the necessary dependencies installed, including:
-
Create a Local Kubernetes Cluster: If you don't already have a cluster, create one with your preferred tool. For example, with
kind:kind create cluster -
Install the Custom Resource Definitions (CRDs): Apply the latest CRDs to your cluster:
make install -
Run the kro Controller Locally: Execute the controller with your changes:
go run ./cmd/controller --zap-log-level=infoThis will connect to the default Kubernetes context in your local kubeconfig (
~/.kube/config). Ensure the context is pointing to your local cluster.
Running the controller inside a KinD cluster with ko
A helper Makefile target is used to (re)create a kind cluster, install the CRDs, build the container image and helm install the controller manifests in the kind cluster.
Note: This target re-creates the kind cluster from scratch and should be used as a starting point or when you want to start over fresh.
KIND_CLUSTER_NAME=kro make deploy-kind
For iterating on an existing cluster, follow the instructions below.
- Prepare the cluster
export KIND_CLUSTER_NAME=my-other-cluster
# Create a kind cluster if needed
kind create cluster
## Create the kro-system namespace
kubectl create namespace kro-system || true
- Build and install KRO components
## install the KRO CRDs
make install
# render the helm chart and apply using ko
export KO_DOCKER_REPO=kind.local
helm template kro ./helm \
--namespace kro-system \
--set image.pullPolicy=Never \
--set image.ko=true | ko apply -f -
Dev Environment Hello World
-
Create a
NoOpResourceGraph using theResourceGraphDefinition.kubectl apply -f - <<EOF apiVersion: kro.run/v1alpha1 kind: ResourceGraphDefinition metadata: name: noop spec: schema: apiVersion: v1alpha1 kind: NoOp spec: {} status: {} resources: [] EOFInspect that the
ResourceGraphDefinitionwas created, and also the newly created CRDNoOp.kubectl get ResourceGraphDefinition noop kubectl get crds | grep noops -
Create an instance of the new
NoOpkind.kubectl apply -f - <<EOF apiVersion: kro.run/v1alpha1 kind: NoOp metadata: name: demo EOFAnd inspect the new instance,
kubectl get noops -oyaml
Testing
Run tests with make test WHAT=unit or make test WHAT=integration.
You can pass additional test flags after --:
# Run specific integration tests by pattern
make test WHAT=integration -- --focus 'GraphRevision Integration'
# Run specific unit test
make test WHAT=unit -- -v -run TestBuilder