@@ -35,19 +35,28 @@ You can see the status of the cluster with:
3535kubectl cluster-info --context kind-capi-test
3636` ` `
3737
38- # ## Create a tilt-settings.json file
38+ # ## Create a tilt-settings file
39+
40+ Next, create a ` tilt-settings.yaml` file and place it in your local copy of ` cluster-api` . Here is an example:
41+
42+ ` ` ` yaml
43+ default_registry: gcr.io/your-project-name-here
44+ provider_repos:
45+ - ../cluster-api-provider-aws
46+ enable_providers" :
47+ - aws
48+ - docker
49+ - kubeadm-bootstrap
50+ - kubeadm-control-plane
51+ ` ` `
3952
40- Next, create a ` tilt-settings.json ` file and place it in your local copy of ` cluster-api ` . Here is an example:
53+ < aside class= " note " >
4154
42- ` ` ` json
43- {
44- " default_registry" : " gcr.io/your-project-name-here" ,
45- " provider_repos" : [" ../cluster-api-provider-aws" ],
46- " enable_providers" : [" aws" , " docker" , " kubeadm-bootstrap" , " kubeadm-control-plane" ]
47- }
48- ` ` `
55+ If you prefer JSON, you can create a ` tilt-settings.json` file instead. YAML will be preferred if both files are present.
56+
57+ < /aside>
4958
50- # ### tilt-settings.json fields
59+ # ### tilt-settings fields
5160
5261** allowed_contexts** (Array, default=[]): A list of kubeconfig contexts Tilt is allowed to use. See the Tilt documentation on
5362[allow_k8s_contexts](https://docs.tilt.dev/api.html#api.allow_k8s_contexts) for more details.
@@ -56,7 +65,7 @@ Next, create a `tilt-settings.json` file and place it in your local copy of `clu
5665documentation](https://docs.tilt.dev/api.html#api.default_registry) for more details.
5766
5867** provider_repos** (Array[]String, default=[]): A list of paths to all the providers you want to use. Each provider must have a
59- ` tilt-provider.json` file describing how to build the provider.
68+ ` tilt-provider.yaml ` or ` tilt-provider. json` file describing how to build the provider.
6069
6170** enable_providers** (Array[]String, default=[' docker' ]): A list of the providers to enable. See [available providers](# available-providers)
6271for more details.
@@ -94,15 +103,13 @@ Supported settings:
94103
95104 Example: Using the configuration below:
96105
97- ` ` ` json
98- " debug" : {
99- " core" : {
100- " continue" : false,
101- " port" : 30000,
102- " profiler_port" : 40000,
103- " metrics_port" : 40001
104- }
105- },
106+ ` ` ` yaml
107+ debug:
108+ core:
109+ continue: false
110+ port: 30000
111+ profiler_port: 40000
112+ metrics_port: 40001
106113 ` ` `
107114
108115 # #### Wiring up debuggers
@@ -140,10 +147,9 @@ Supported settings:
140147
141148For example, if the yaml contains ` ${AWS_B64ENCODED_CREDENTIALS} ` , you could do the following:
142149
143- ` ` ` json
144- " kustomize_substitutions" : {
145- " AWS_B64ENCODED_CREDENTIALS" : " your credentials here"
146- }
150+ ` ` ` yaml
151+ kustomize_substitutions:
152+ AWS_B64ENCODED_CREDENTIALS: " your credentials here"
147153` ` `
148154
149155{{# /tab }}
@@ -172,26 +178,24 @@ An Azure Service Principal is needed for populating the controller manifests. Th
172178 AZURE_CLIENT_ID=$( az ad sp show --id http://$AZURE_SERVICE_PRINCIPAL_NAME --query appId --output tsv)
173179 ` ` `
174180
175- Add the output of the following as a section in your ` tilt-settings.json ` :
181+ Add the output of the following as a section in your ` tilt-settings.yaml ` :
176182
177183 ` ` ` shell
178184 cat << EOF
179- "kustomize_substitutions": {
180- "AZURE_SUBSCRIPTION_ID_B64": "$( echo " ${AZURE_SUBSCRIPTION_ID} " | tr -d ' \n' | base64 | tr -d ' \n' ) ",
181- "AZURE_TENANT_ID_B64": "$( echo " ${AZURE_TENANT_ID} " | tr -d ' \n' | base64 | tr -d ' \n' ) ",
182- "AZURE_CLIENT_SECRET_B64": "$( echo " ${AZURE_CLIENT_SECRET} " | tr -d ' \n' | base64 | tr -d ' \n' ) ",
183- "AZURE_CLIENT_ID_B64": "$( echo " ${AZURE_CLIENT_ID} " | tr -d ' \n' | base64 | tr -d ' \n' ) "
184- }
185+ kustomize_substitutions:
186+ AZURE_SUBSCRIPTION_ID_B64: "$( echo " ${AZURE_SUBSCRIPTION_ID} " | tr -d ' \n' | base64 | tr -d ' \n' ) "
187+ AZURE_TENANT_ID_B64: "$( echo " ${AZURE_TENANT_ID} " | tr -d ' \n' | base64 | tr -d ' \n' ) "
188+ AZURE_CLIENT_SECRET_B64: "$( echo " ${AZURE_CLIENT_SECRET} " | tr -d ' \n' | base64 | tr -d ' \n' ) "
189+ AZURE_CLIENT_ID_B64: "$( echo " ${AZURE_CLIENT_ID} " | tr -d ' \n' | base64 | tr -d ' \n' ) "
185190 EOF
186191` ` `
187192
188193{{# /tab }}
189194{{#tab DigitalOcean}}
190195
191- ` ` ` json
192- "kustomize_substitutions": {
193- "DO_B64ENCODED_CREDENTIALS": "your credentials here"
194- }
196+ ` ` ` yaml
197+ kustomize_substitutions:
198+ DO_B64ENCODED_CREDENTIALS: "your credentials here"
195199` ` `
196200
197201{{# /tab }}
@@ -202,10 +206,9 @@ You can generate a base64 version of your GCP json credentials file using:
202206base64 -i ~/path/to/gcp/credentials.json
203207` ` `
204208
205- ` ` ` json
206- "kustomize_substitutions": {
207- "GCP_B64ENCODED_CREDENTIALS": "your credentials here"
208- }
209+ ` ` ` yaml
210+ kustomize_substitutions:
211+ GCP_B64ENCODED_CREDENTIALS: "your credentials here"
209212` ` `
210213
211214{{# /tab }}
@@ -223,14 +226,11 @@ for this provider. Each item in the array will be passed in to the manager for t
223226
224227Example:
225228
226- ` ` ` json
227- {
228- " extra_args" : {
229- " core" : [" --feature-gates=MachinePool=true" ],
230- " kubeadm-bootstrap" : [" --feature-gates=MachinePool=true" ],
231- " azure" : [" --feature-gates=MachinePool=true" ]
232- }
233- }
229+ ` ` ` yaml
230+ extra_args:
231+ core: [" --feature-gates=MachinePool=true" ]
232+ kubeadm-bootstrap: [" --feature-gates=MachinePool=true" ]
233+ azure: [" --feature-gates=MachinePool=true" ]
234234` ` `
235235
236236With this config, the respective managers will be invoked with:
@@ -274,23 +274,25 @@ The following providers are currently defined in the Tiltfile:
274274* **core**: cluster-api itself (Cluster/Machine/MachineDeployment/MachineSet/KubeadmConfig/KubeadmControlPlane)
275275* **docker**: Docker provider (DockerCluster/DockerMachine)
276276
277- ### tilt-provider.json
278-
279- A provider must supply a `tilt-provider.json` file describing how to build it. Here is an example:
280-
281- ```json
282- {
283- "name": "aws",
284- "config": {
285- "image": "gcr.io/k8s-staging-cluster-api-aws/cluster-api-aws-controller",
286- "live_reload_deps": [
287- "main.go", "go.mod", "go.sum", "api", "cmd", "controllers", "pkg"
288- ]
289- },
290- "label": "CAPA"
291- }
277+ ### tilt-provider configuration
278+
279+ A provider must supply a `tilt-provider.yaml` file describing how to build it. Here is an example:
280+
281+ ```yaml
282+ name: aws
283+ label: CAPA
284+ config:
285+ image: "gcr.io/k8s-staging-cluster-api-aws/cluster-api-aws-controller",
286+ live_reload_deps: ["main.go", "go.mod", "go.sum", "api", "cmd", "controllers", "pkg"]
292287```
293288
289+
290+ <aside class="note">
291+
292+ If you prefer JSON, you can create a `tilt-provider.json` file instead. YAML will be preferred if both files are present.
293+
294+ </aside>
295+
294296#### config fields
295297
296298**image**: the image for this provider, as referenced in the kustomize files. This must match; otherwise, Tilt won' t
@@ -337,13 +339,13 @@ is immediately before the "real work" happens.
337339
338340At a high level, the Tiltfile performs the following actions:
339341
340- 1. Read ` tilt-settings.json `
342+ 1. Read ` tilt-settings.yaml `
3413431. Configure the allowed Kubernetes contexts
3423441. Set the default registry
3433451. Define the ` providers` map
3443461. Include user-defined Tilt files
3453471. Deploy cert-manager
346- 1. Enable providers (` core` + what is listed in ` tilt-settings.json ` )
348+ 1. Enable providers (` core` + what is listed in ` tilt-settings.yaml ` )
347349 1. Build the manager binary locally as a ` local_resource`
348350 1. Invoke ` docker_build` for the provider
349351 1. Invoke ` kustomize` for the provider' s `config/` directory
0 commit comments