-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use PrivateDnsName as Node name in nodeadm #1715
Conversation
0657a2b
to
28671c8
Compare
|
||
// Discovers all cluster details using a describe call to the eks endpoint and | ||
// updates the value of the config's `ClusterDetails` in-place | ||
func populateClusterDetails(eksClient *eks.EKS, clusterName string, cfg *api.NodeConfig) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was unused and we've decided to require these args in the user data.
a7014d6
to
0d404a2
Compare
|
||
"github.com/aws/aws-sdk-go-v2/feature/ec2/imds" | ||
"github.com/aws/aws-sdk-go/service/eks" | ||
"github.com/aws/aws-sdk-go-v2/service/ec2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for the -28k lines 😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the least I could do
@@ -249,7 +249,9 @@ func (ksc *kubeletConfig) withCloudProvider(kubeletVersion string, cfg *api.Node | |||
flags["cloud-provider"] = "external" | |||
// provider ID needs to be specified when the cloud provider is external | |||
ksc.ProviderID = ptr.String(getProviderId(cfg.Status.Instance.AvailabilityZone, cfg.Status.Instance.ID)) | |||
// TODO set the --hostname-override equal to the EC2 PrivateDnsName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC think there's a unit test with the corresponding TODO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just a fork of the internal waiter impls in the SDK, very little net-new code
/ci Seeing what the runtime behavior looks like while I update the e2e tests... |
@cartermckinnon roger that! I've dispatched a workflow. 👍 |
@cartermckinnon the workflow that you requested has completed. 🎉
|
0d404a2
to
572206b
Compare
/ci |
@cartermckinnon roger that! I've dispatched a workflow. 👍 |
@cartermckinnon the workflow that you requested has completed. 🎉
|
572206b
to
5395fb9
Compare
/ci Problem was that the aws-go-sdk-v2 doesn't detect the runtime region from IMDS automatically, you have to enable this behavior with a config option. |
@cartermckinnon roger that! I've dispatched a workflow. 👍 |
@cartermckinnon the workflow that you requested has completed. 🎉
|
@@ -145,7 +145,14 @@ func (c *initCmd) Run(log *zap.Logger, opts *cli.GlobalOptions) error { | |||
// perform in-place updates when allowed by the user | |||
func enrichConfig(log *zap.Logger, cfg *api.NodeConfig) error { | |||
log.Info("Fetching instance details..") | |||
instanceDetails, err := api.GetIMDSInstanceDetails(context.TODO(), imds.New(imds.Options{})) | |||
imdsClient := imds.New(imds.Options{}) | |||
awsConfig, err := config.LoadDefaultConfig(context.TODO(), config.WithClientLogMode(aws.LogRetries), config.WithEC2IMDSRegion(func(o *config.UseEC2IMDSRegion) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah! thanks for the fix. 💚
Beautiful! Thank you for this fix, @cartermckinnon. |
Issue #, if available:
#1711
Description of changes:
Sets the
--hostname-override
on k8s 1.26+ to the EC2PrivateDnsName
.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.