Quickstart
This guide stands up Nexus on a local Kind cluster, then creates a tenant and deploys an agent — via kubectl and via the REST API.
Prerequisites
Section titled “Prerequisites”| Tool | Purpose |
|---|---|
| Docker | Container runtime |
| kubectl | Kubernetes CLI |
| Kind | Local Kubernetes clusters |
| Helm | Optional — chart-based deploy on existing clusters |
| Make | Build orchestration |
Fast Path: Bootstrap on Kind
Section titled “Fast Path: Bootstrap on Kind”A single script creates a Kind cluster (nexus-local), installs dependencies, builds and deploys the Nexus controller, and seeds a dev account, tenant, and API key.
./hack/bootstrap.shUnder the hood it runs these stages in order:
| Stage | Script | What it does |
|---|---|---|
| 0 | deploy/bootstrap/00-cluster.sh | Creates the Kind cluster nexus-local |
| 1 | deploy/bootstrap/01-dependencies.sh | Installs in-cluster dependencies |
| 2 | deploy/bootstrap/02-astromesh-node.sh | Stages the astromesh-node components |
| 3 | deploy/bootstrap/03-nexus.sh | Builds + loads the image, installs CRDs, deploys the controller |
| 4 | deploy/bootstrap/04-seed.sh | Registers a dev account, creates a tenant, generates an API key |
On success it prints:
Nexus ready at http://localhost:8080The seed step also prints the dev credentials, tenant ID, and raw API key — save the API key, it is shown only once.
Manual install on an existing cluster
Section titled “Manual install on an existing cluster”If you already have a cluster, the controller deploy is what stage 3 runs:
make docker-build IMG=nexus:dev # build the controller imagekind load docker-image nexus:dev --name nexus-local # Kind onlymake install # install CRDskubectl create namespace nexus-systemmake deploy IMG=nexus:dev # deploy the controllerkubectl rollout status deployment/nexus-controller-manager -n nexus-system --timeout=120sFor non-Kind clusters, push the image to a registry (make docker-push IMG=...) and deploy with the Helm chart in deploy/helm/nexus/ instead of make deploy.
Create a Tenant
Section titled “Create a Tenant”Option A — kubectl
Section titled “Option A — kubectl”Apply the sample manifests directly:
kubectl apply -f config/samples/nexus_v1alpha1_nexustenant.yamlkubectl get nexustenants -n nexus-systemWait for PHASE to reach Ready. The reconciler will have created the tenant namespace, the astromesh-node Deployment/Service, and recorded status.nodeEndpoint.
Option B — REST API
Section titled “Option B — REST API”Register, log in, create a tenant, and mint an API key (the dev account below is created by the bootstrap seed step):
API_URL="http://localhost:8080"
# Log in and capture the JWTTOKEN=$(curl -sf -X POST "$API_URL/auth/login" \ -H "Content-Type: application/json" \ -d '{"email":"dev@astromesh.local","password":"astromesh-dev-2024"}' \ | python3 -c "import sys,json; print(json.load(sys.stdin)['accessToken'])")
# Create a tenant (JWT required)curl -sf -X POST "$API_URL/api/v1/tenants" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{"displayName":"My Tenant","nodeProfile":"full"}'# -> { "id": "t_...", "crName": "tenant-...", "displayName": "My Tenant" }Deploy an Agent
Section titled “Deploy an Agent”Option A — kubectl
Section titled “Option A — kubectl”kubectl apply -f config/samples/nexus_v1alpha1_nexusagent.yamlkubectl get nexusagents -n tenant-devThe NexusAgentReconciler resolves the tenant’s node endpoint, registers and deploys the agent, and moves it Pending → Deploying → Running.
Option B — REST API
Section titled “Option B — REST API”The agent endpoints accept the agent spec YAML as the raw request body and are tenant-scoped, so the simplest path is an X-API-Key. Save your agent spec to a file and POST it:
# support-bot.yaml contains a full astromesh/v1 Agent speccurl -sf -X POST "$API_URL/api/v1/agents" \ -H "X-API-Key: $NEXUS_API_KEY" \ -H "Content-Type: application/yaml" \ --data-binary @support-bot.yaml# -> { "name": "support-bot", "namespace": "tenant-..." }Verify
Section titled “Verify”# CRskubectl get nexustenants -n nexus-systemkubectl get nexusagents -n tenant-dev
# Via the APIcurl -sf -H "X-API-Key: $NEXUS_API_KEY" "$API_URL/api/v1/agents"curl -sf -H "X-API-Key: $NEXUS_API_KEY" "$API_URL/api/v1/agents/support-bot/status"A healthy agent reports phase: Running and nodeAck: true.
Teardown
Section titled “Teardown”./hack/teardown.shThis deletes the nexus-local Kind cluster and everything in it. On an existing cluster, use helm uninstall nexus -n nexus-system followed by make uninstall to remove the CRDs.
What’s Next
Section titled “What’s Next”- API Reference — full endpoint table and a complete curl walkthrough.
- Architecture — how the reconcilers and CRDs fit together.