Local Development Setup¶
- Prerequisites
- Preperation
- Run libvirt-provider for local development
- Interact with the
libvirt-provider - Deploy
libvirt-provider
ℹ️ NOTE: To be able to take exec console of the machine, you can follow any one of the below approaches: - Run the
libvirt-provideras thelibvirt-qemuuser. - Add user tottygroup and create an entry withdevpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=0660 0 0in/etc/fstab. - Manually ensure that you have0660access permissions on the character files created in/dev/pts.
Prerequisites¶
- Linux (code contains OS specific code)
- go >= 1.20
git,makeandkubectl- Access to a Kubernetes cluster (Minikube, kind or a real cluster)
- libvirt
- QEMU
irictl-machineshould be running locally or as container
Preperation¶
Setup irictl-machine¶
-
Clone ironcore repository
git clone git@github.com:ironcore-dev/ironcore.git cd ironcore -
Build
irictl-machinego build -o bin/irictl-machine ./irictl-machine/cmd/irictl-machine/main.go
Run libvirt-provider for local development¶
-
Clone the Repository
To bring up and start locally the libvirt-provider project for development purposes you first need to clone the repository.
git clone git@github.com:ironcore-dev/libvirt-provider.git cd libvirt-provider -
Build the
libvirt-providermake build -
Run the
libvirt-providerThe required libvirt-provider flags needs to be defined:
go run provider/cmd/main.go \ --libvirt-provider-dir=<path-to-initialize-libvirt-provider> \ --supported-machine-classes=<path-to-machine-class-json>/machine-classes.json \ --network-interface-plugin-name=isolated \ --address=<local-path>/iri-machinebroker.sockSample
machineclasses.yamlcan be found here.
Interact with the libvirt-provider¶
-
Creating machine
irictl-machine --address=unix:<local-path-to-socket>/iri-machinebroker.sock create machine -f <path-to-machine-yaml>/iri-machine.yamlSample
iri-machine.yaml:metadata: id: 91076287116041d00fd421f43c3760389041dac4a8bd9201afba9a5baeb21c7 labels: downward-api.machinepoollet.api.onmetal.de/root-machine-name: machine-hd4 downward-api.machinepoollet.api.onmetal.de/root-machine-namespace: default downward-api.machinepoollet.api.onmetal.de/root-machine-uid: cab82eac-09d8-4428-9e6c-c98b40027b74 machinepoollet.api.onmetal.de/machine-name: machine-hd4 machinepoollet.api.onmetal.de/machine-namespace: default machinepoollet.api.onmetal.de/machine-uid: cab82eac-09d8-4428-9e6c-c98b40027b74 spec: class: x3-small image: image: ghcr.io/ironcore-dev/ironcore-image/gardenlinux:rootfs-dev-20231206-v1 volumes: - empty_disk: size_bytes: 5368709120 name: ephe-disk device: oda -
Listing machines
irictl-machine --address=unix:<local-path-to-socket>/iri-machinebroker.sock get machine -
Deleting machine
irictl-machine --address=unix:<local-path-to-socket>/iri-machinebroker.sock delete machine <machine UUID> -
Taking machine console
irictl-machine --address=unix:<local-path-to-socket>/iri-machinebroker.sock exec <machine UUID>
Deploy libvirt-provider¶
ℹ️ NOTE: If the
libvirt-urican not be auto-detected it can be defined via flag: e.g.--libvirt-uri=qemu:///sessionℹ️ NOTE: For trying out the controller use theisolatednetwork interface plugin:--network-interface-plugin-name=isolatedℹ️ NOTE: Libvirt-provider can run directly as binary program on worker node
-
Make docker images
make docker-build -
Deploy virtlet as kubernetes
make deploy