Having issues overlaying v0.8.0.iso with my own kernel cmdline values
Is your feature request related to a problem? Please describe.
What does data sources even mean? Attempting to boot from USB, very little documentation as to what "data sources" relates to aside from "cloud provider" - is this a config file in a bucket? What does provider matter for?
Describe the solution you'd like
A simple way to create a bootable USB device to provision k3os server & agent nodes with a cloud config.yaml
Describe alternatives you've considered
booting from usb with cloud config pointed at a gist to no avail.
Additional context
Regularly am unable to mount sdb device when installing from ISO USB. Issue relates to not having a partition on a disk, in this particular scenario /dev/sda
mount /.base: wrong fs type, bad option, bad superblock on /dev/sdb3
@Kampe referencing https://github.com/rancher/k3os/blob/master/README.md#k3osdata_sources:
k3os.data_sources_These are the data sources used for download config from cloud provider_. The valid options are
aws gcp openstack packet scaleway vultr cdrom
Emphasis mine. I agree that it is a bit poorly named but it is by now fairly standard usage in this context (cloud-init/cloud-config/user-data/meta-data). With a configured data-source, we treat any readable user-data from it as either a script (if a shebang line is detected) to be executed or config.yaml to be merged with other config from your system. That said, data-sources are not relevant to your use case because you are booting from USB.
The simplest way to boot with your custom config is to place it at /k3os/system/config.yaml on your USB media. If you are re-mastering the ISO, you can drop your config.yaml at images/07-iso/config.yaml and it will show up at /k3os/system/config.yaml in the ISO.
I wish there were a better place to ask this, but what is the cdrom data-source? What file is it looking for, and on what media? I have a suspicion that we'll end up having to remaster the ISO in any case, but it'd be nice to have some of this documented.
I'd be happy to help with that documentation, but I'll be honest, searching for datasource only pulls up one result in read_test.go, and 3 instances in the packer bits.
Is there an IRC/Slack channel to ask these questions?
The cdrom data source is probably the least well understood outside the confines of vSphere and yet one of the most flexible (it works on any system with cdrom/dvd drives). I鈥檓 cooking dinner at the moment so I don鈥檛 have the source on my phone but if I remember correctly this driver scans through /dev/sr* and in order attempts to mount the devices. The first one found with a user-data.txt will end the search and that file will be used as cloud-init userdata otherwise known in k3OS as config.yaml.
We鈥檝e got a #k3os channel in the rancher users slack. rancher-users.slack.com iirc
@anoldguy i wrapped our vsphere code in a cli https://github.com/luthermonson/quiso and there is some reading and links to inspiration in the README.
so, yeah, I dunno where I am remembering user-data.txt from but linuxkit/metadata looks for config at the root of the ISO: https://github.com/linuxkit/linuxkit/blob/master/pkg/metadata/provider_cdrom.go#L12
@luthermonson: quiso seems to be nice tool, but is unable to produce the 'config' file that linuxkit/metadata is looking for.
@dweomer, @zimme: how about modifying @ibuildthecloud's forked version of linuxkit/metadata to look for a file called 'user-data' in provider_cdrom.go?
I'm trying to use k3os with the 'cloud-init' feature of Proxmox.
This is a screen dump of the content of the ISO.

I've forked another ISO building tool, to create cloudinit-for-k3os.
k3os-build.sh creates a hard link from user-data to config before making the ISO image.
With that, it IS now possible to use k3os.data_sources=cdrom when installing k3os.
Stay tuned, for more to come. And keep listening to #66.
a suggestion would be to look at the python implementation of the cloud-init/cloud-config package that is used by debian/ubuntu etc and do a pr to update linuxkit/metadata's cdrom provider to work the same way.
This is what I did for hetzner and scaleway
so, yeah, I dunno where I am remembering
user-data.txtfrom butlinuxkit/metadatalooks forconfigat the root of the ISO: https://github.com/linuxkit/linuxkit/blob/master/pkg/metadata/provider_cdrom.go#L12
As of linuxkit v0.8 it seems to be possible to use "user-data" as a file name.
This has been modified a few weeks ago here and is now implemented in linuxkit v0.8
Hey @gfeun,
The linuxkit v0.8 solution you mention, seems and reads as an interesting approach. However, how can we benefit from that within K3OS?
Thank you
Hey @larssb,
My use case was to inject configuration in my k3os VMs using cloud init.
The problem was that the typical "user-data" filename was not recognised by k3os on boot when using cloud init cdrom data source. linuxkit 0.8 introduced support for user-data filename for cloud init.
Since linuxkit v0.8 is now included inside k3os (https://github.com/rancher/k3os/blob/7279320fef0478564b0c4a435e57e2ae1e629ef7/images/20-progs/Dockerfile#L6) this should be solved but I have not tested.
Aaah then this solution by @pagong does not sound to be necessary to use anymore.
Am I right?
Don't know this specific project but according to the readme you are right it seems to no longer be necessary:
That's why this fork is needed: create a hard link from user-data to config before making the ISO image.
Due to my day job, I didn't have much time lately to try out k3os 0.11.1. 鈽癸笍
If k3os is using the fixed, upstream linuxkit, then my little tool is no longer needed.
Most helpful comment
The
cdromdata source is probably the least well understood outside the confines of vSphere and yet one of the most flexible (it works on any system with cdrom/dvd drives). I鈥檓 cooking dinner at the moment so I don鈥檛 have the source on my phone but if I remember correctly this driver scans through/dev/sr*and in order attempts to mount the devices. The first one found with auser-data.txtwill end the search and that file will be used ascloud-inituserdata otherwise known in k3OS asconfig.yaml.