Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions cloud/aws/node/generate-setup-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
8 changes: 5 additions & 3 deletions cloud/aws/node/scripts/setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,18 @@ 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"
$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
}

Expand All @@ -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
Expand Down Expand Up @@ -126,5 +127,6 @@ Push-Location $TempPath
& .\Install-EKSWorkerNode.ps1
Pop-Location


# Perform cleanup
Remove-Item -Path "$TempRoot" -Recurse -Force