Comments (5)
Next step is convert the script into Tinkerbell workflow.
Some things to consider:
- virt-customize may not work on OSIE inside Docker container. If it's not, we can copy files over by mounting the new partition I guess.
from cluster-api-provider-tinkerbell.
canonical/cloud-init#680 is relevant since the metadata formats are related.
from cluster-api-provider-tinkerbell.
I was discussing this with @dustinmiller1337 @pereztr5 and @mmlb very recently.
In the Equinix Metal world, the DMI fields do not uniformly identify that the devices are running in EM. It is advantageous for us to do this so that users and tools like cloud-init can identify their environment.
In Tinkerbell, I don't know if we can make the same assumptions about manipulating the device DMI. In some cases, the DMI can only be updated with hardware-specific software.
This problem is top on my mind now, especially as it relates to this conversation: canonical/cloud-init#680 (comment). It is not preferable for cloud-init to base its data source detection on the existence of a known metadata service.
from cluster-api-provider-tinkerbell.
Okay, I figured out how to run the code above as a Workflow. Findings:
virt-customize
works on OSIE, but pulling it into Docker image makes installation image quite big (1GB+), which causes troubles on OSIE, as on the worker with 4GB of RAM, the tmpfs is 50% RAM size, so 2GB and this image can barely unpack on it. I switched to use simplypartprobe
+mount
which seems simpler and also does the job.
Dockerfile
content for for ubuntu-install
image:
FROM alpine:3.12
RUN apk add -U qemu-img
And workflow template:
version: "0.1"
name: ubuntu-install
global_timeout: 1800
tasks:
- name: "ubuntu-install"
worker: "{{.machine1}}"
volumes:
- /dev:/dev
- /statedir:/statedir
actions:
- name: "dump-cloud-init"
image: ubuntu-install
command:
- sh
- -c
- |
echo '{{.cloudInit}}' | base64 -d > /statedir/90_dpkg.cfg
- name: "download-image"
image: ubuntu-install
command:
- sh
- -c
- |
# TODO: Pull image from Tinkerbell nginx and convert it there, so we can pipe
# wget directly into dd.
/usr/bin/wget https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img -O /statedir/focal-server-cloudimg-amd64.img
- name: "write-image-to-disk"
image: ubuntu-install
command:
- sh
- -c
- |
/usr/bin/qemu-img convert -f qcow2 -O raw /statedir/focal-server-cloudimg-amd64.img /dev/vda
- name: "write-cloud-init-config"
image: ubuntu-install
command:
- sh
- -c
- |
set -eux
partprobe /dev/vda
mkdir -p /mnt/target
mount -t ext4 /dev/vda1 /mnt/target
cp /statedir/90_dpkg.cfg /mnt/target/etc/cloud/cloud.cfg.d/
umount /mnt/target
- name: "reboot" # This task shouldn't really be there, but there is no other way to reboot the Tinkerbell Worker into target OS in Tinkerbell for now.
image: ubuntu-install
command:
- sh
- -c
- |
echo 1 > /proc/sys/kernel/sysrq; echo b > /proc/sysrq-trigger
Then, create a workflow like:
tink workflow create -t <template ID> -r '{"machine1": "<mac>", "cloudInit": "<base64 encoded cloud-init data>"}'
from cluster-api-provider-tinkerbell.
The MVP part is figured out, so let's close this as done.
from cluster-api-provider-tinkerbell.
Related Issues (20)
- Update Tink dependency HOT 1
- v0.4 HOT 1
- Remove boilerplate and associated validation code
- can we add CAPT operators to operatorhub.io? HOT 2
- Investigate CAPI upgrades
- Upgrade Go version to 1.19
- Move away from tools.go
- Use `actions/setup-go` instead of our own wrapper HOT 1
- Possible race condition
- Consume Tink v1alpha2 APIs
- how to try capt on real hardware HOT 3
- Default mirror setting missing?
- Add Rufio to the quickstart
- v0.5.0 release
- Same Hardware assigned to multiple TinkerbellMachines when maxUnavailable >= 2 in MachineDeployment HOT 2
- Add Flatcar systemd-sysext how to HOT 1
- Implement retries for BMC interactions
- release process builds a broken infrastructure-components.yaml
- Update how network booting is disabled
- TinkerbellMachine's cannot be deleted when the bound Hardware doesn't exist
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cluster-api-provider-tinkerbell.