Skip to content

Latest commit

 

History

History
71 lines (51 loc) · 1.6 KB

File metadata and controls

71 lines (51 loc) · 1.6 KB

Developer Guide

This guide is for contributors working from a local checkout.

Run against the current cluster

Install CRDs into the current cluster:

make install

Run the controller locally against the current kubeconfig context:

make run

Build and deploy the controller image:

export IMG=<registry>/cluster-api-provider-stackit:<tag>
make docker-build docker-push IMG="$IMG"
make deploy IMG="$IMG"

For a local kind management cluster, build and load the image instead of pushing it:

export IMG=cluster-api-provider-stackit:dev
make docker-build IMG="$IMG"
kind load docker-image "$IMG" --name capi-stackit
make deploy IMG="$IMG"

The local development cluster used during validation is kind-capi-stackit.

Use locally built provider assets

Build a local clusterctl repository:

export IMG=cluster-api-provider-stackit:dev
make clusterctl-release IMG="${IMG}"
export STACKIT_CLUSTERCTL_REPOSITORY="$(pwd)/dist/clusterctl"

Create a Kind management cluster and install the local provider assets:

kind create cluster --name capi-stackit
kubectl config use-context kind-capi-stackit

clusterctl init \
  --config hack/clusterctl-local.yaml \
  --core cluster-api \
  --bootstrap kubeadm \
  --control-plane kubeadm \
  --infrastructure stackit:v0.1.0

Build and load the image, then deploy the controller:

make docker-build IMG="${IMG}"
kind load docker-image "${IMG}" --name capi-stackit
make deploy IMG="${IMG}"

hack/clusterctl-local.yaml enables CLUSTER_TOPOLOGY so ClusterClass and topology clusters can pass the Cluster API admission webhooks.