tink icon indicating copy to clipboard operation
tink copied to clipboard

Add documentation for passing cloud-init metadata

Open wangxin311 opened this issue 5 years ago • 4 comments

For service provisioning, customer need pass cloud-init info to create user/get package, etc. tink should handle cloud-init via metadata, but it's not clear on how to pass cloud-init data to metadata server and retrieve it during boot up.

wangxin311 avatar May 13 '20 16:05 wangxin311

Cloud-init can use Hegel via the EC2 metadata support. See https://docs.tinkerbell.org/services/hegel

See https://cloudinit.readthedocs.io/en/latest/topics/datasources/ec2.html#configuration for how to configure custom metadata URLs.

As described in https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html#datasource-nocloud, these values can be provided in the Kernel command line arguments:

ds=ec2;metadata_urls=http://{insert_hegel_ip_and_port}/

You can use a workflow like https://artifacthub.io/packages/tbaction/tinkerbell-community/kexec to provide a custom kernel argument (CMD_LINE).

Alternatively, with https://artifacthub.io/packages/tbaction/tinkerbell-community/writefile you can write a custom cloud.cfg file (https://cloudinit.readthedocs.io/en/latest/topics/faq.html#where-are-the-configuration-files) which defines the location of the metadata service, similar to https://github.com/tinkerbell/osie-og/blob/ebbe709e1f2b035fe2345e99a8d3aed77f2c22a4/docker/scripts/osie.sh#L298-L307.

You would want to replace metadata.packet.net with the Hegel address via templated workflows and variables (https://docs.tinkerbell.org/templates/ and https://docs.tinkerbell.org/workflows/working-with-workflows/#creating-a-workflow)).

displague avatar Aug 10 '21 18:08 displague

I think we can improve the documentation at https://docs.tinkerbell.org/services/hegel to more easily demonstrate how to do this.

Is that what you were looking for @wangxin311?

displague avatar Aug 10 '21 18:08 displague

@nshalman has some experience with this

tstromberg avatar Aug 27 '21 03:08 tstromberg

sounds like we could definitely use some help documenting how to integrate with cloud-init. Anyone out there that has done this or is interested in this?? We could most definitely use help creating this document.

jacobweinstock avatar Jan 11 '22 16:01 jacobweinstock

There's an on-going documentation overhaul effort. I've added this as something for consideration. For more information please track https://github.com/tinkerbell/roadmap/issues/5.

chrisdoherty4 avatar Dec 27 '22 03:12 chrisdoherty4