Setup CAPG Tutorial
This tutorial will guide you through getting a local development loop setup for CAPG that utilizes Tilt. This guide assumes you have already run through the steps in our Prerequisites Guide.
Get the source
The first step is to clone the repo so that you have a local copy. Follow the commands below to create the clone.
git clone https://github.com/kubernetes-sigs/cluster-api-provider-gcp
cd cluster-api-provider-gcp
Setting Up Tilt
From the root of the CAPG repository, run the following to generate a tilt-settings.json file with your GCP
service account credentials:
cat <<EOF > tilt-settings.json
{
"kustomize_substitutions": {
"GCP_B64ENCODED_CREDENTIALS": "$(cat PATH_FOR_GCP_CREDENTIALS_JSON | base64 -w0)"
}
}
EOF
To build a KinD cluster and start Tilt, just run:
make tilt-up
Checking It Works
Running make tilt-up will give you an option to open a browser-based UI that can be very useful for monitoring the
different pieces in the Tilt stack.
When all of the elements in this UI go green your local development is ready to use!
Where Next?
To use CAPG to provision a workload cluster, follow the instructions in our Running CAPG Locally guide.