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

support hostname-override-source #59

Merged

Conversation

tzneal
Copy link
Contributor

@tzneal tzneal commented Jul 30, 2024

Issue number:

Closes #

Description of changes:

Supports the new hostname-override-source setting to we can use the instance-id as the node name with K8s.

Testing done:

Built & verified that the following AMIs launched and joined the cluster with the correct node name for the following scenarios:
1.23 - No userdata
1.29 - No userdata
1.29 - hostname-override-source = private-dns-name
1.29 - hostname-override-source = instance-id

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

sources/api/pluto/src/main.rs Outdated Show resolved Hide resolved
@tzneal tzneal force-pushed the add-hostname-override-source branch from 9d7f90b to d3a75f5 Compare July 31, 2024 14:27
Comment on lines +387 to +389
KubernetesHostnameOverrideSource::InstanceID => {
aws_k8s_info.hostname_override = Some(instance_id);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: it'd be slightly better to fetch the instance ID within this block, as otherwise we pay for the cost of an IMDS interaction and end up throwing away the result when using the private DNS source

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use it both places, in the private DNS lookup we filter by the instance ID so we only get the single response.

@ginglis13 ginglis13 merged commit 99da8a2 into bottlerocket-os:develop Jul 31, 2024
2 checks passed
@tzneal tzneal deleted the add-hostname-override-source branch August 2, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants