Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for passing cloud-init metadata #110

Closed
wangxin311 opened this issue May 13, 2020 · 5 comments
Closed

Add documentation for passing cloud-init metadata #110

wangxin311 opened this issue May 13, 2020 · 5 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/documentation Categorizes issue or PR as related to documentation. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.

Comments

@wangxin311
Copy link

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.

@displague
Copy link
Member

displague commented Aug 10, 2021

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 displague added the kind/documentation Categorizes issue or PR as related to documentation. label Aug 10, 2021
@displague
Copy link
Member

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?

@tstromberg
Copy link
Contributor

@nshalman has some experience with this

@tstromberg tstromberg changed the title tink need handle cloud-init data via metadata Add documentation for passing cloud-init metadata Aug 27, 2021
@tstromberg tstromberg added the priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. label Aug 27, 2021
@jacobweinstock jacobweinstock added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Jan 11, 2022
@jacobweinstock
Copy link
Member

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.

@chrisdoherty4
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/documentation Categorizes issue or PR as related to documentation. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
None yet
Development

No branches or pull requests

5 participants