Closed rbankston closed 6 years ago
xref - https://github.com/kubernetes/kubeadm/issues/653 , as it's in a similar vein.
@rbankston I'm not sure that the metadata local-hostname is available in all cases. I think it depends on having dns configured for the vpc. Granted you need dns configured on the VPC if you want to use the cloud-provider integration, which I suspect most users would want to do if they are running the quickstart :grinning:
@detiber Pretty sure that the local-hostname is always available based on a few docs I've read. The dhcp documentation calls out local-hostname always being set regardless of other vpc options. The bit of the docs that says it should always be available is:
By default, all instances in a nondefault VPC receive an unresolvable host name that AWS assigns (for example, ip-10-0-0-202)
simple hack fix for this.
change
hostname -f
to
hostname -f 2>/dev/null || curl http://169.254.169.254/latest/meta-data/local-hostname
I can submit a pr if you want tho simple to change in the ~3 files
-Rylan
Can confirm the curl to metadata on AWS works even without hostname -f available. This is thanks to testing done by @krazik. @timothysc we ok to submit a pr to fix that up for getting around hostname -f failures?
-Ralph
Definitely submit a PR. This is the biggest issue we've run into in the last 6 months. Based on our current prios we'll get to it in the next week or two, but it'll be better to have the PR ready to go. Thanks for looking into this!
Pull request exists as https://github.com/heptio/aws-quickstart/pull/177
@rbankston did you know you can add "Closes #171" to your PR (either commit or PR description) and the ticket will auto close? :D
Currently this project relies on hostname -f to provide hostname resolution. This call can be broken based on dhcp changes. We've seen this happen when launching into an existing vpc like issues #118, and #129. This could rely on instance metadata which works regardless of dhcp settings. The change would consist of replacing:
with
the rest of the scripts behavior would remain unchanged.