From c1053a1cc6f33e8dcae4702545788b2572d4a4bf Mon Sep 17 00:00:00 2001 From: Nick Baker Date: Fri, 1 Mar 2024 18:54:49 +0000 Subject: [PATCH] increase nodeadm network resilience * increase retries and total retry window for imds client * set nodeadm config step to wait for `network-online` --- nodeadm/internal/configprovider/userdata.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nodeadm/internal/configprovider/userdata.go b/nodeadm/internal/configprovider/userdata.go index 06edaba85..7f785b7a3 100644 --- a/nodeadm/internal/configprovider/userdata.go +++ b/nodeadm/internal/configprovider/userdata.go @@ -9,7 +9,9 @@ import ( "mime/multipart" "net/mail" "strings" + "time" + "github.com/aws/aws-sdk-go-v2/aws/retry" "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" "github.com/awslabs/amazon-eks-ami/nodeadm/api" internalapi "github.com/awslabs/amazon-eks-ami/nodeadm/internal/api" @@ -29,7 +31,12 @@ type userDataConfigProvider struct { func NewUserDataConfigProvider() ConfigProvider { return &userDataConfigProvider{ - imdsClient: imds.New(imds.Options{}), + imdsClient: imds.New(imds.Options{ + Retryer: retry.NewStandard(func(so *retry.StandardOptions) { + so.MaxAttempts = 15 + so.MaxBackoff = 1 * time.Second + }), + }), } }