Instructions for AI coding agents. For project overview, see README.md. For full environment variables list, see vars.md.
Development and testing environment for the Metal3 stack. Sets up a local Kubernetes cluster with Ironic, BMO, CAPM3, and simulated bare metal hosts using libvirt VMs. Used for local development and as the foundation for CI pipelines in all Metal3 projects.
Warning: Scripts are intrusive and reconfigure host networking/libvirt. Must be run in a dedicated VM, not on a developer workstation.
AI agents: Do NOT run make, setup scripts, or host-modifying commands
unless explicitly confirmed by user that the environment is a dedicated
Metal3 dev VM. Lint scripts (make lint, ./hack/markdownlint.sh) are
always safe.
| Directory | Purpose |
|---|---|
lib/ |
Shared bash functions (common.sh, network.sh, images.sh) |
tests/ |
Ansible-based test framework and scripts |
vm-setup/ |
Libvirt VM definitions (Ansible roles) |
hack/ |
CI scripts (shellcheck, markdownlint) |
| File | Purpose |
|---|---|
01_prepare_host.sh |
Install dependencies (libvirt, kubectl, etc.) |
02_configure_host.sh |
Setup networks, create VMs |
03_launch_mgmt_cluster.sh |
Create management cluster (kind/minikube) |
04_verify.sh |
Verify deployment |
Makefile |
Primary interface |
Run locally before PRs:
| Command | Purpose |
|---|---|
make |
Full setup (prepare, configure, launch, verify) |
make clean |
Cleanup everything |
make lint |
Run shellcheck |
./hack/markdownlint.sh |
Markdown linting |
Essential variables (see vars.md for complete list):
IMAGE_OS- Target OS:ubuntu,centos,flatcar(default:ubuntu)CAPM3_VERSION,CAPI_VERSION- Component versionsEPHEMERAL_CLUSTER- Cluster type:kind,minikube,tiltBMC_DRIVER- BMC protocol:ipmi,redfish,redfish-virtualmedia
Testing local changes:
CAPM3_PATH- Local path to CAPM3 repoBAREMETAL_OPERATOR_PATH- Local path to BMO repoIPAM_PATH- Local path to IPAM repo
- Shell: Use
set -exin scripts - Source
lib/common.shfor shared functions
This repo is the foundation for Metal3 CI:
- CAPM3 E2E tests run on top of metal3-dev-env
- Jenkins pipelines in project-infra use this
- Pre-built node images from Nordix artifactory (
IMAGE_LOCATION)
When reviewing pull requests:
- Compatibility - Changes must work across Ubuntu/CentOS/Flatcar
- CI impact - Consider effects on CAPM3 e2e and Jenkins pipelines
- Idempotency - Scripts should be re-runnable
- Cleanup -
make cleanmust fully reset state
Focus on: lib/, 0*_*.sh, tests/, vm-setup/.
- Read
vars.mdfor environment variable documentation - Check
lib/common.shfor existing helper functions - Run
make lintbefore committing - Test changes with
make clean && make