This document describes how to build and iterate upon the Equinix Metal (formerly Packet) infrastructure provider.
This is not intended for regular users.
We recommend following the upstream Developing Cluster API with Tilt guide for iterative test and development of CAPP.
-
git clone kubernetes-sigs/cluster-api-provider-packet
-
git clone kubernetes-sigs/cluster-api
-
Move to the cluster-api-provider-packet directory
cd cluster-api-provider-packet
-
git checkout "branch-you're-testing"
-
Move to the cluster-api directory you checked out earlier:
cd ../cluster-api
-
Install tilt and kind
brew install tilt brew install kind
-
Create the tilt-settings.json file in the cluster-api folder.
touch cluster-api/tilt-settings.json
-
Copy the following into that file, updating the <> sections with relevant info:
{ "default_registry": "ghcr.io/<your github username>", "provider_repos": ["../cluster-api-provider-packet"], "enable_providers": ["packet","kubeadm-bootstrap","kubeadm-control-plane"], "kustomize_substitutions": { "PACKET_API_KEY": "<API_KEY>", "EXP_CLUSTER_RESOURCE_SET": "true", "EXP_MACHINE_POOL": "true", "CLUSTER_TOPOLOGY": "true" } }
-
Create a cluster.
-
Change to the directory where you checked out both projects
cd ~
-
Run the kind install for capd script included in the cluster-api repository:
cluster-api/hack/kind-install-for-capd.sh
-
Navigate to the cluster-api directory and run:
tilt up
-
Get another terminal window
cd cluster-api-provider-packet
-
-
You now have a choice:
-
clusterctl
clusterctl generate cluster my-cluster --kubernetes-version=1.23.6 --control-plane-machine-count=1 --worker-machine-count=1 --from templates/cluster-template-kube-vip.yaml > test-kube-vip.yaml
-
Set your kubernetes context to the cluster created in kind
kubectl apply -f test-kube-vip.yaml
-
-
e2e testing
-
Run your e2e tests.
make test-e2e-local
-
-