diff --git a/Tiltfile b/Tiltfile index ebf6682aee26..e34b0c9d994a 100644 --- a/Tiltfile +++ b/Tiltfile @@ -52,7 +52,6 @@ providers = { "feature", ], "label": "CAPI", - "manager_name": "capi-controller-manager", }, "kubeadm-bootstrap": { "context": "bootstrap/kubeadm", @@ -66,7 +65,6 @@ providers = { "../../go.sum", ], "label": "CABPK", - "manager_name": "capi-kubeadm-bootstrap-controller-manager", }, "kubeadm-control-plane": { "context": "controlplane/kubeadm", @@ -80,7 +78,6 @@ providers = { "../../go.sum", ], "label": "KCP", - "manager_name": "capi-kubeadm-control-plane-controller-manager", }, "docker": { "context": "test/infrastructure/docker", @@ -166,7 +163,6 @@ COPY manager . # 3. Runs kustomize for the provider's config/default and applies it def enable_provider(name, debug): p = providers.get(name) - manager_name = p.get("manager_name") context = p.get("context") go_main = p.get("go_main", "main.go") label = p.get("label", name) @@ -285,6 +281,8 @@ def enable_provider(name, debug): yaml = str(kustomize_with_envsubst(context + "/config/default", True)) k8s_yaml(blob(yaml)) + manager_name = find_manager(context + "/config/default") + k8s_resource( workload = manager_name, new_name = label.lower() + "_controller", @@ -293,6 +291,15 @@ def enable_provider(name, debug): links = links, ) +def find_manager(path): + return local_output( + '{kustomize_cmd} build {path} | {yq_cmd} eval \'select(."kind"=="Deployment").metadata.name\' -'.format( + kustomize_cmd = kustomize_cmd, + path = path, + yq_cmd = yq_cmd, + ), + ) + # Users may define their own Tilt customizations in tilt.d. This directory is excluded from git and these files will # not be checked in to version control. def include_user_tilt_files(): diff --git a/docs/book/src/developer/providers/implementers-guide/building_running_and_testing.md b/docs/book/src/developer/providers/implementers-guide/building_running_and_testing.md index 6349e6a2401a..8fb05fb72f1b 100644 --- a/docs/book/src/developer/providers/implementers-guide/building_running_and_testing.md +++ b/docs/book/src/developer/providers/implementers-guide/building_running_and_testing.md @@ -20,7 +20,7 @@ Cluster API uses [cert-manager] to manage the certificates it needs for its webh Before you apply Cluster API's yaml, you should [install `cert-manager`][cm-install] [cert-manager]: https://github.com/jetstack/cert-manager -[cm-install]: https://docs.cert-manager.io/en/latest/getting-started/install/kubernetes.html +[cm-install]: https://cert-manager.io/docs/installation/ ``` kubectl apply -f https://github.com/jetstack/cert-manager/releases/download//cert-manager.yaml diff --git a/docs/book/src/developer/tilt.md b/docs/book/src/developer/tilt.md index c7601ca27273..e4bab2070bae 100644 --- a/docs/book/src/developer/tilt.md +++ b/docs/book/src/developer/tilt.md @@ -79,17 +79,6 @@ for more details. **kustomize_substitutions** (Map{String: String}, default={}): An optional map of substitutions for `${}`-style placeholders in the provider's yaml. -{{#tabs name:"tab-tilt-kustomize-substitution" tabs:"AWS,Azure,DigitalOcean,GCP"}} -{{#tab AWS}} - -For example, if the yaml contains `${AWS_B64ENCODED_CREDENTIALS}`, you could do the following: - -```json -"kustomize_substitutions": { - "AWS_B64ENCODED_CREDENTIALS": "your credentials here" -} -``` - **debug** (Map{string: Map} default{}): A map of named configurations for the provider. The key is the name of the provider. Supported settings: @@ -154,6 +143,17 @@ Supported settings: configuration](https://www.jetbrains.com/help/go/attach-to-running-go-processes-with-debugger.html#step-3-create-the-remote-run-debug-configuration-on-the-client-computer) pointing at port 30000. +{{#tabs name:"tab-tilt-kustomize-substitution" tabs:"AWS,Azure,DigitalOcean,GCP"}} +{{#tab AWS}} + +For example, if the yaml contains `${AWS_B64ENCODED_CREDENTIALS}`, you could do the following: + +```json +"kustomize_substitutions": { + "AWS_B64ENCODED_CREDENTIALS": "your credentials here" +} +``` + {{#/tab }} {{#tab AZURE}} @@ -294,7 +294,8 @@ A provider must supply a `tilt-provider.json` file describing how to build it. H "live_reload_deps": [ "main.go", "go.mod", "go.sum", "api", "cmd", "controllers", "pkg" ] - } + }, + "label": "CAPA" } ``` @@ -332,8 +333,6 @@ Set to `false` if your provider does not have a ./config folder or you do not wa in tilt version >= v0.22.2 (see https://blog.tilt.dev/2021/08/09/resource-grouping.html); as a convention, provider abbreviation should be used (CAPD, KCP etc.). -**manager_name** (String): If provided, it will allow tilt to move the provider controller under the above label. - ## Customizing Tilt If you need to customize Tilt's behavior, you can create files in cluster-api's `tilt.d` directory. This file is ignored