This repository includes scripts to set up a Metal³ development environment.
Instructions can be found here: https://metal3.io/try-it.html
Versions v1alpha3 or v1alpha4 are later referred as v1alphaX.
The v1alphaX deployment can be done with Ubuntu 18.04, 20.04 or Centos 8 target host images. By default, for Ubuntu based target hosts we are using Ubuntu 20.04
The requirements for the dev env machine are, when deploying Ubuntu target hosts:
- 8GB of memory
- 4 cpus
And when deploying Centos target hosts:
- 16GB of memory
- 4 cpus
The Minikube machine is deployed with 4GB of RAM, and 2 vCPUs, and the target hosts with 4 vCPUs and 4GB of RAM.
Select:
export CAPM3_VERSION=v1alpha3
or
export CAPM3_VERSION=v1alpha4
The following environment variables need to be set for Centos:
export IMAGE_OS=Centos
And the following environment variables need to be set for Ubuntu:
export IMAGE_OS=Ubuntu
You can check a list of all the environment variables here
./01_prepare_host.sh
./02_configure_host.sh
./03_launch_mgmt_cluster.sh
or
make
./scripts/provision/cluster.sh
./scripts/provision/controlplane.sh
./scripts/provision/worker.sh
./scripts/provision/pivot.sh
kubectl delete cluster "${CLUSTER_NAME:-"test1"}" -n metal3
It is possible to use Tilt to run the CAPI and CAPM3 components. For this, run:
export EPHEMERAL_CLUSTER="tilt"
make
Then clone the Cluster API Provider Metal3 repository, and follow the instructions. That will mostly be the three following blocks of commands.
source lib/common.sh
source lib/network.sh
source lib/images.sh
and go to the CAPM3 repository and run
make tilt-settings
Please refer to the CAPM3 instructions to include BMO and IPAM. Then run :
make tilt-up
Once the cluster is running, you can create the BareMetalHosts :
kubectl create namespace metal3
kubectl apply -n metal3 -f /opt/metal3-dev-env/bmhosts_crs.yaml
Afterwards, you can deploy a target cluster.
If you are running tilt on a remote machine, you can forward the web interface
by adding the following parameter to the ssh command -L 10350:127.0.0.1:10350
Then you can access the Tilt dashboard locally here
In case, you want recreate the local ironic containers enabled with TLS, you need to use the following instructions:
source lib/common.sh
source lib/network.sh
export IRONIC_HOST="${CLUSTER_URL_HOST}"
export IRONIC_HOST_IP="${CLUSTER_PROVISIONING_IP}"
source lib/ironic_tls_setup.sh
source lib/ironic_basic_auth.sh
cd ${BMOPATH}
./tools/run_local_ironic.sh
Here ${BMOPATH}
points to the baremetal operator directory. For more
information, regarding the TLS setup and running ironic locally please refer to
these documents:
TLS
, Run local ironic.