diff --git a/cloud/aws/node/generate-setup-script.py b/cloud/aws/node/generate-setup-script.py index 76940b8..7e3911c 100755 --- a/cloud/aws/node/generate-setup-script.py +++ b/cloud/aws/node/generate-setup-script.py @@ -121,7 +121,7 @@ def s3UriToHttpsUrl(s3Uri): 'get-component', '--region=us-east-1', '--component-build-version-arn', - 'arn:aws:imagebuilder:us-east-1:aws:component/eks-optimized-ami-windows/1.24.0' + 'arn:aws:imagebuilder:us-east-1:aws:component/eks-optimized-ami-windows/1.26.0/1' ])) # Parse the pipeline YAML data and extract the list of constants @@ -335,9 +335,15 @@ def s3UriToHttpsUrl(s3Uri): for c in step['inputs']['commands'] if not c.startswith('$ErrorActionPreference') ]) + + elif action == 'WebDownload': + generated += '$webClient = New-Object System.Net.WebClient' + for input in step['inputs']: + generated += ('\n$webClient.DownloadFile("' + Utility.replaceConstants(input['source'], constants) + '", "' + + Utility.replaceConstants(input['destination'], constants) + '")') - elif action == 'Reboot': - Utility.log('Ignoring reboot step.') + elif action == 'Reboot' or action == 'MoveFolder': + Utility.log('Ignoring ' + action + ' step.') continue else: diff --git a/cloud/aws/node/scripts/setup.ps1 b/cloud/aws/node/scripts/setup.ps1 index d156182..2786ebe 100644 --- a/cloud/aws/node/scripts/setup.ps1 +++ b/cloud/aws/node/scripts/setup.ps1 @@ -30,9 +30,10 @@ function PatchFile # Constants $KubernetesPath = "$env:ProgramFiles\Kubernetes" -$KubernetesDownload = "https://amazon-eks.s3.amazonaws.com/1.24.7/2022-10-31/bin/windows/amd64" +$KubernetesDownload = "https://amazon-eks.s3.amazonaws.com/1.26.2/2023-03-17/bin/windows/amd64" $ContainerdPath = "$env:ProgramFiles\containerd" $EKSPath = "$env:ProgramFiles\Amazon\EKS" +$DomainlessGmsaPath = "$EKSPath\gmsa-plugin" $CNIPath = "$EKSPath\cni" $CSIProxyPath = "$EKSPath\bin" $EKSLogsPath = "$env:ProgramData\Amazon\EKS\logs" @@ -40,7 +41,7 @@ $TempRoot = "C:\TempEKSArtifactDir" $TempPath = "$TempRoot\EKS-Artifacts" # Create each of our directories -foreach ($dir in @($ContainerdPath, $KubernetesPath, $EKSPath, $CNIPath, $CSIProxyPath, $EKSLogsPath, $TempRoot)) { +foreach ($dir in @($ContainerdPath, $KubernetesPath, $EKSPath, $CNIPath, $CSIProxyPath, $EKSLogsPath, $DomainlessGmsaPath, $TempRoot)) { New-Item -Path $dir -ItemType Directory -Force | Out-Null } @@ -57,7 +58,7 @@ $webClient.DownloadFile("$KubernetesDownload/kube-proxy.exe", "$KubernetesPath\k $webClient.DownloadFile("$KubernetesDownload/aws-iam-authenticator.exe", "$EKSPath\aws-iam-authenticator.exe") # Download the EKS artifacts archive -$webClient.DownloadFile("https://ec2imagebuilder-managed-resources-us-east-1-prod.s3.amazonaws.com/components/eks-optimized-ami-windows/1.24.0/EKS-Artifacts.zip", "C:\EKS-Artifacts.zip") +$webClient.DownloadFile("https://ec2imagebuilder-managed-resources-us-east-1-prod.s3.amazonaws.com/components/eks-optimized-ami-windows/1.26.0/EKS-Artifacts.zip", "C:\EKS-Artifacts.zip") # Extract the EKS artifacts archive Expand-Archive -Path "C:\EKS-Artifacts.zip" -DestinationPath $TempRoot @@ -126,5 +127,6 @@ Push-Location $TempPath & .\Install-EKSWorkerNode.ps1 Pop-Location + # Perform cleanup Remove-Item -Path "$TempRoot" -Recurse -Force