Skip to content

jschoone/metal3-dev-env

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Metal³ Development Environment

This repository includes scripts to set up a Metal³ development environment.

Build Status

Ubuntu V1alpha4 build status CentOS V1alpha4 build status Ubuntu V1alpha5 build status CentOS V1alpha5 build status Ubuntu V1beta1 build status CentOS V1beta1 build status

Instructions

Instructions can be found here: https://metal3.io/try-it.html

Quickstart

Versions v1alpha4, v1alpha5 or v1beta1 are later referred as v1alphaX/v1betaX.

The v1alphaX or v1betaX deployment can be done with Ubuntu 18.04, 20.04 or Centos 8 Stream target host images. By default, for Ubuntu based target hosts we are using Ubuntu 20.04

Requirements

Dev env size

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.

Environment variables

Select:

export CAPM3_VERSION=v1alpha4
export CAPI_VERSION=v1alpha3

or

export CAPM3_VERSION=v1alpha5
export CAPI_VERSION=v1alpha4

or

export CAPM3_VERSION=v1beta1
export CAPI_VERSION=v1beta1

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

And the following environment variables need to be set for Flatcar:

export IMAGE_OS=Flatcar

You can check a list of all the environment variables here

Deploy the metal3 Dev env

./01_prepare_host.sh
./02_configure_host.sh
./03_launch_mgmt_cluster.sh

or

make

Deploy the target cluster

./scripts/provision/cluster.sh
./scripts/provision/controlplane.sh
./scripts/provision/worker.sh

Pivot to the target cluster

./scripts/provision/pivot.sh

Delete the target cluster

kubectl delete cluster "${CLUSTER_NAME:-"test1"}" -n metal3

Deploying with Tilt

It is possible to use Tilt to run the CAPI, BMO 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 -f examples/metal3crds/metal3.io_baremetalhosts.yaml
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

Recreating local ironic containers

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.

About

Metal³ Development Environment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 81.3%
  • Python 8.8%
  • Jinja 8.3%
  • Makefile 1.6%