Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ make kind-reset

**tilt-settings.yaml** is required with Azure credentials (see docs/book/src/developers/development.md for details).

`make tilt-up` runs `check-az-cli`; if `az` is missing, it warns and tells you to install the Azure CLI and retry `make tilt-up` (needed for Tilt flows that call `az`, e.g. VNet peering with AKS as management cluster). Use `VERBOSE=1 make check-az-cli` to print the detected binary path.

### E2E Testing

```bash
Expand Down
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -829,8 +829,19 @@ aks-create: $(KUBECTL) ## Create aks cluster as mgmt cluster.
aks-delete: $(KUBECTL) ## Deletes the resource group and the associated AKS clusters listed under allowed_contexts in ./tilt-settings.yaml .
./scripts/aks-delete.sh

.PHONY: check-az-cli
check-az-cli: ## Warn if Azure CLI (az) is not installed (Tilt uses it for VNet peering with AKS management clusters). Set VERBOSE=1 to print path when found.
@if ! command -v az >/dev/null 2>&1; then \
echo "WARNING: Azure CLI (az) is not installed or not on your PATH."; \
echo " Please install it before continuing with Tilt; without it, steps that call 'az' (for example VNet peering with an AKS management cluster) will fail."; \
echo " Install: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli"; \
echo " After installing, ensure 'az' is on your PATH, then run make tilt-up again."; \
elif [ -n "$(VERBOSE)" ]; then \
echo "Azure CLI (az) found: $$(command -v az)"; \
fi

.PHONY: tilt-up
tilt-up: install-tools ## Start tilt and build kind cluster if needed.
tilt-up: install-tools check-az-cli ## Start tilt and build kind cluster if needed.
@if [ -z "${AZURE_CLIENT_ID_USER_ASSIGNED_IDENTITY}" ]; then \
export AZURE_CLIENT_ID_USER_ASSIGNED_IDENTITY=$(shell cat $(AZURE_IDENTITY_ID_FILEPATH)); \
fi; \
Expand Down
1 change: 0 additions & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,6 @@ def waitforsystem():
local(kubectl_cmd + " wait --for=condition=ready --timeout=300s pod --all -n capi-system")

def peer_vnets():
# TODO: check for az cli to be installed in local
peering_cmd = '''
echo "--------Peering VNETs--------";
az network vnet wait --resource-group ${AKS_RESOURCE_GROUP} --name ${AKS_MGMT_VNET_NAME} --created --timeout 180;
Expand Down
2 changes: 2 additions & 0 deletions docs/book/src/developers/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ Install [Helm](https://helm.sh/docs/intro/install/):

You would require installation of Helm for successfully setting up Tilt.

Install the [Azure CLI][azure_cli] if you use Tilt workflows that invoke `az` against Azure (for example VNet peering when using an AKS management cluster with an internal load balancer; see [Tilt with AKS as management cluster (ILB)](tilt-with-aks-as-mgmt-ilb.md)). `make tilt-up` runs `make check-az-cli` first; if `az` is missing, it prints a warning that asks you to install the CLI and fix your `PATH` before continuing with Tilt. To print the resolved `az` path when it is installed, run `VERBOSE=1 make check-az-cli`.

### Using Tilt

Both of the [Tilt](https://tilt.dev) setups below will get you started developing CAPZ in a local kind cluster.
Expand Down
Loading