Overview
Iterating on infrastructure directly against cloud VMs is slow, expensive, and error-prone. To enable fast, deterministic development, infra-bootstrap-tools provides a completely local end-to-end testing harness that mirrors production cloud clusters.
Using Kind (Kubernetes in Docker) and a local OCI container registry, you can bootstrap the entire Flux D2 GitOps pipeline, deploy OpenZiti, and verify zero-trust networking right on your workstation.
The One-Command Workflow
You can spin up the test environment and run the full verification test suite with a single command:
make test-flux-d2
This automated target executes two coordinated steps:
- Provisions a local Kind cluster and Docker container registry (
bin/k8s/setup-kind-local-registry.sh). - Pushes the local monorepo manifests as OCI artifacts and validates cluster reconciliation (
bin/tests/flux-d2/test.sh).
Under the Hood: Architecture of the Test Harness
The test harness runs entirely on the developer workstation:
Local Docker Registry (
localhost:5000):- Manifests packaged and pushed via
flux push artifact:oci://localhost:5000/manifests/fleet/kind:latestoci://localhost:5000/manifests/infra-addons:latest
- Manifests packaged and pushed via
Local Kind Cluster (
kindest/node:v1.32.0):containerdconfiguration wired to routelocalhost:5000to the local registry container.- Flux Operator installed via Helm.
- Reconciles
fleet/kind/flux-system/flux-instance.yaml. - Deploys and validates cert-manager, trust-manager, keycloak, and openziti.
Stable Node Images
The Kind cluster configuration explicitly pins the node image to kindest/node:v1.32.0. This prevents sudden breakages caused by bleeding-edge upstream Kubernetes releases (such as v1.35.0 system changes) and guarantees parity with CI test runners (.github/workflows/flux-d2-test.yml).
Verification Assertions
The test script (bin/tests/flux-d2/test.sh) does not merely check if pods are scheduled; it performs deep, end-to-end functional assertions:
- OCI Artifact Sync:
Verifies that
OCIRepository/flux-systemandOCIRepository/infra-addonspull artifacts fromlocalhost:5000without authentication errors. - Kustomization Health:
Monitors
kustomization/infra-addons-valuesandkustomization/infra-addonsuntil both reportstatus: "True"andreason: ReconciliationSucceeded. - Trust & Certificate Infrastructure:
Confirms
cert-managerandtrust-managerpods achieveReadystatus and bundle webhooks respond. - Identity & OpenZiti Mesh:
- Asserts the local Keycloak deployment enters ready state.
- Waits for the
ziti-controllerdeployment to pass health checks. - Monitors the
ziti-router-enrollJob to ensure automated token generation and router enrollment succeed (SuccessfulCreate). - Asserts the
ziti-routerHelmRelease and pods achieve full readiness.
Development Environment Setup
All required CLIs (kind, kubectl, helm, flux, docker) are packaged into the dedicated Nix development shell:
# Enter the Flux-focused Nix environment
nix develop .#flux
# Run tests
make test-flux-d2
Useful Troubleshooting Commands
While the cluster is running, you can inspect the GitOps status interactively:
# View all Flux resources and synchronization status
flux get all -A
# Check for HelmRelease reconciliation errors
flux get helmreleases -A
# Inspect router enrollment logs
kubectl logs -n openziti job/ziti-router-enroll
# Destroy the local test cluster when done
kind delete cluster --name kind
docker rm -f kind-registry