Skip to content

Commit

Permalink
feat: bump new CSE and skip CleanupNetwork controlled by AKS toggle (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiqianTao authored Apr 23, 2024
1 parent 1f6497b commit e596bb9
Show file tree
Hide file tree
Showing 20 changed files with 64 additions and 19 deletions.
4 changes: 3 additions & 1 deletion parts/windows/kuberneteswindowssetup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ $global:EnableIncreaseDynamicPortRange = $false

$global:RebootNeeded = $false

$global:IsSkipCleanupNetwork = [System.Convert]::ToBoolean("{{GetVariable "isSkipCleanupNetwork" }}");

# Extract cse helper script from ZIP
[io.file]::WriteAllBytes("scripts.zip", [System.Convert]::FromBase64String($zippedFiles))
Expand-Archive scripts.zip -DestinationPath "C:\\AzureData\\" -Force
Expand All @@ -239,7 +241,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.41.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.42.zip"
Write-Log "CSEScriptsPackageUrl is $global:CSEScriptsPackageUrl"
Write-Log "WindowsCSEScriptsPackage is $WindowsCSEScriptsPackage"
# Old AKS RP sets the full URL (https://acs-mirror.azureedge.net/aks/windows/cse/aks-windows-cse-scripts-v0.0.11.zip) in CSEScriptsPackageUrl
Expand Down
6 changes: 6 additions & 0 deletions pkg/agent/datamodel/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,12 @@ func (a *AgentPoolProfile) IsWindows() bool {
return strings.EqualFold(string(a.OSType), string(Windows))
}

// IsSkipCleanupNetwork returns true if AKS-RP sets the field NotRebootWindowsNode to true.
func (a *AgentPoolProfile) IsSkipCleanupNetwork() bool {
// Reuse the existing field NotRebootWindowsNode to avoid adding a new field because it is a temporary toggle value from AKS-RP.
return a.NotRebootWindowsNode != nil && *a.NotRebootWindowsNode
}

// IsVirtualMachineScaleSets returns true if the agent pool availability profile is VMSS.
func (a *AgentPoolProfile) IsVirtualMachineScaleSets() bool {
return strings.EqualFold(a.AvailabilityProfile, VirtualMachineScaleSets)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ $global:EnableIncreaseDynamicPortRange = $false

$global:RebootNeeded = $false

$global:IsSkipCleanupNetwork = [System.Convert]::ToBoolean("false");

# Extract cse helper script from ZIP
[io.file]::WriteAllBytes("scripts.zip", [System.Convert]::FromBase64String($zippedFiles))
Expand-Archive scripts.zip -DestinationPath "C:\\AzureData\\" -Force
Expand All @@ -235,7 +237,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.41.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.42.zip"
Write-Log "CSEScriptsPackageUrl is $global:CSEScriptsPackageUrl"
Write-Log "WindowsCSEScriptsPackage is $WindowsCSEScriptsPackage"
# Old AKS RP sets the full URL (https://acs-mirror.azureedge.net/aks/windows/cse/aks-windows-cse-scripts-v0.0.11.zip) in CSEScriptsPackageUrl
Expand Down
4 changes: 3 additions & 1 deletion pkg/agent/testdata/AKSWindows2019+CustomCloud/CustomData
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ $global:EnableIncreaseDynamicPortRange = $false

$global:RebootNeeded = $false

$global:IsSkipCleanupNetwork = [System.Convert]::ToBoolean("false");

# Extract cse helper script from ZIP
[io.file]::WriteAllBytes("scripts.zip", [System.Convert]::FromBase64String($zippedFiles))
Expand-Archive scripts.zip -DestinationPath "C:\\AzureData\\" -Force
Expand All @@ -235,7 +237,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.41.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.42.zip"
Write-Log "CSEScriptsPackageUrl is $global:CSEScriptsPackageUrl"
Write-Log "WindowsCSEScriptsPackage is $WindowsCSEScriptsPackage"
# Old AKS RP sets the full URL (https://acs-mirror.azureedge.net/aks/windows/cse/aks-windows-cse-scripts-v0.0.11.zip) in CSEScriptsPackageUrl
Expand Down
4 changes: 3 additions & 1 deletion pkg/agent/testdata/AKSWindows2019+CustomVnet/CustomData
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ $global:EnableIncreaseDynamicPortRange = $false

$global:RebootNeeded = $false

$global:IsSkipCleanupNetwork = [System.Convert]::ToBoolean("false");

# Extract cse helper script from ZIP
[io.file]::WriteAllBytes("scripts.zip", [System.Convert]::FromBase64String($zippedFiles))
Expand-Archive scripts.zip -DestinationPath "C:\\AzureData\\" -Force
Expand All @@ -235,7 +237,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.41.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.42.zip"
Write-Log "CSEScriptsPackageUrl is $global:CSEScriptsPackageUrl"
Write-Log "WindowsCSEScriptsPackage is $WindowsCSEScriptsPackage"
# Old AKS RP sets the full URL (https://acs-mirror.azureedge.net/aks/windows/cse/aks-windows-cse-scripts-v0.0.11.zip) in CSEScriptsPackageUrl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ $global:EnableIncreaseDynamicPortRange = $false

$global:RebootNeeded = $false

$global:IsSkipCleanupNetwork = [System.Convert]::ToBoolean("false");

# Extract cse helper script from ZIP
[io.file]::WriteAllBytes("scripts.zip", [System.Convert]::FromBase64String($zippedFiles))
Expand-Archive scripts.zip -DestinationPath "C:\\AzureData\\" -Force
Expand All @@ -235,7 +237,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.41.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.42.zip"
Write-Log "CSEScriptsPackageUrl is $global:CSEScriptsPackageUrl"
Write-Log "WindowsCSEScriptsPackage is $WindowsCSEScriptsPackage"
# Old AKS RP sets the full URL (https://acs-mirror.azureedge.net/aks/windows/cse/aks-windows-cse-scripts-v0.0.11.zip) in CSEScriptsPackageUrl
Expand Down
4 changes: 3 additions & 1 deletion pkg/agent/testdata/AKSWindows2019+K8S116/CustomData
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ $global:EnableIncreaseDynamicPortRange = $false

$global:RebootNeeded = $false

$global:IsSkipCleanupNetwork = [System.Convert]::ToBoolean("false");

# Extract cse helper script from ZIP
[io.file]::WriteAllBytes("scripts.zip", [System.Convert]::FromBase64String($zippedFiles))
Expand-Archive scripts.zip -DestinationPath "C:\\AzureData\\" -Force
Expand All @@ -235,7 +237,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.41.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.42.zip"
Write-Log "CSEScriptsPackageUrl is $global:CSEScriptsPackageUrl"
Write-Log "WindowsCSEScriptsPackage is $WindowsCSEScriptsPackage"
# Old AKS RP sets the full URL (https://acs-mirror.azureedge.net/aks/windows/cse/aks-windows-cse-scripts-v0.0.11.zip) in CSEScriptsPackageUrl
Expand Down
4 changes: 3 additions & 1 deletion pkg/agent/testdata/AKSWindows2019+K8S117/CustomData
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ $global:EnableIncreaseDynamicPortRange = $false

$global:RebootNeeded = $false

$global:IsSkipCleanupNetwork = [System.Convert]::ToBoolean("false");

# Extract cse helper script from ZIP
[io.file]::WriteAllBytes("scripts.zip", [System.Convert]::FromBase64String($zippedFiles))
Expand-Archive scripts.zip -DestinationPath "C:\\AzureData\\" -Force
Expand All @@ -235,7 +237,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.41.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.42.zip"
Write-Log "CSEScriptsPackageUrl is $global:CSEScriptsPackageUrl"
Write-Log "WindowsCSEScriptsPackage is $WindowsCSEScriptsPackage"
# Old AKS RP sets the full URL (https://acs-mirror.azureedge.net/aks/windows/cse/aks-windows-cse-scripts-v0.0.11.zip) in CSEScriptsPackageUrl
Expand Down
4 changes: 3 additions & 1 deletion pkg/agent/testdata/AKSWindows2019+K8S118/CustomData
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ $global:EnableIncreaseDynamicPortRange = $false

$global:RebootNeeded = $false

$global:IsSkipCleanupNetwork = [System.Convert]::ToBoolean("false");

# Extract cse helper script from ZIP
[io.file]::WriteAllBytes("scripts.zip", [System.Convert]::FromBase64String($zippedFiles))
Expand-Archive scripts.zip -DestinationPath "C:\\AzureData\\" -Force
Expand All @@ -235,7 +237,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.41.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.42.zip"
Write-Log "CSEScriptsPackageUrl is $global:CSEScriptsPackageUrl"
Write-Log "WindowsCSEScriptsPackage is $WindowsCSEScriptsPackage"
# Old AKS RP sets the full URL (https://acs-mirror.azureedge.net/aks/windows/cse/aks-windows-cse-scripts-v0.0.11.zip) in CSEScriptsPackageUrl
Expand Down
4 changes: 3 additions & 1 deletion pkg/agent/testdata/AKSWindows2019+K8S119+CSI/CustomData
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ $global:EnableIncreaseDynamicPortRange = $false

$global:RebootNeeded = $false

$global:IsSkipCleanupNetwork = [System.Convert]::ToBoolean("false");

# Extract cse helper script from ZIP
[io.file]::WriteAllBytes("scripts.zip", [System.Convert]::FromBase64String($zippedFiles))
Expand-Archive scripts.zip -DestinationPath "C:\\AzureData\\" -Force
Expand All @@ -235,7 +237,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.41.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.42.zip"
Write-Log "CSEScriptsPackageUrl is $global:CSEScriptsPackageUrl"
Write-Log "WindowsCSEScriptsPackage is $WindowsCSEScriptsPackage"
# Old AKS RP sets the full URL (https://acs-mirror.azureedge.net/aks/windows/cse/aks-windows-cse-scripts-v0.0.11.zip) in CSEScriptsPackageUrl
Expand Down
4 changes: 3 additions & 1 deletion pkg/agent/testdata/AKSWindows2019+K8S119+FIPS/CustomData
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ $global:EnableIncreaseDynamicPortRange = $false

$global:RebootNeeded = $false

$global:IsSkipCleanupNetwork = [System.Convert]::ToBoolean("false");

# Extract cse helper script from ZIP
[io.file]::WriteAllBytes("scripts.zip", [System.Convert]::FromBase64String($zippedFiles))
Expand-Archive scripts.zip -DestinationPath "C:\\AzureData\\" -Force
Expand All @@ -235,7 +237,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.41.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.42.zip"
Write-Log "CSEScriptsPackageUrl is $global:CSEScriptsPackageUrl"
Write-Log "WindowsCSEScriptsPackage is $WindowsCSEScriptsPackage"
# Old AKS RP sets the full URL (https://acs-mirror.azureedge.net/aks/windows/cse/aks-windows-cse-scripts-v0.0.11.zip) in CSEScriptsPackageUrl
Expand Down
4 changes: 3 additions & 1 deletion pkg/agent/testdata/AKSWindows2019+K8S119/CustomData
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ $global:EnableIncreaseDynamicPortRange = $false

$global:RebootNeeded = $false

$global:IsSkipCleanupNetwork = [System.Convert]::ToBoolean("false");

# Extract cse helper script from ZIP
[io.file]::WriteAllBytes("scripts.zip", [System.Convert]::FromBase64String($zippedFiles))
Expand-Archive scripts.zip -DestinationPath "C:\\AzureData\\" -Force
Expand All @@ -235,7 +237,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.41.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.42.zip"
Write-Log "CSEScriptsPackageUrl is $global:CSEScriptsPackageUrl"
Write-Log "WindowsCSEScriptsPackage is $WindowsCSEScriptsPackage"
# Old AKS RP sets the full URL (https://acs-mirror.azureedge.net/aks/windows/cse/aks-windows-cse-scripts-v0.0.11.zip) in CSEScriptsPackageUrl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ $global:EnableIncreaseDynamicPortRange = $false

$global:RebootNeeded = $false

$global:IsSkipCleanupNetwork = [System.Convert]::ToBoolean("false");

# Extract cse helper script from ZIP
[io.file]::WriteAllBytes("scripts.zip", [System.Convert]::FromBase64String($zippedFiles))
Expand-Archive scripts.zip -DestinationPath "C:\\AzureData\\" -Force
Expand All @@ -235,7 +237,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.41.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.42.zip"
Write-Log "CSEScriptsPackageUrl is $global:CSEScriptsPackageUrl"
Write-Log "WindowsCSEScriptsPackage is $WindowsCSEScriptsPackage"
# Old AKS RP sets the full URL (https://acs-mirror.azureedge.net/aks/windows/cse/aks-windows-cse-scripts-v0.0.11.zip) in CSEScriptsPackageUrl
Expand Down
4 changes: 3 additions & 1 deletion pkg/agent/testdata/AKSWindows2019+ManagedIdentity/CustomData
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ $global:EnableIncreaseDynamicPortRange = $false

$global:RebootNeeded = $false

$global:IsSkipCleanupNetwork = [System.Convert]::ToBoolean("false");

# Extract cse helper script from ZIP
[io.file]::WriteAllBytes("scripts.zip", [System.Convert]::FromBase64String($zippedFiles))
Expand-Archive scripts.zip -DestinationPath "C:\\AzureData\\" -Force
Expand All @@ -235,7 +237,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.41.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.42.zip"
Write-Log "CSEScriptsPackageUrl is $global:CSEScriptsPackageUrl"
Write-Log "WindowsCSEScriptsPackage is $WindowsCSEScriptsPackage"
# Old AKS RP sets the full URL (https://acs-mirror.azureedge.net/aks/windows/cse/aks-windows-cse-scripts-v0.0.11.zip) in CSEScriptsPackageUrl
Expand Down
4 changes: 3 additions & 1 deletion pkg/agent/testdata/AKSWindows2019+SecurityProfile/CustomData
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ $global:EnableIncreaseDynamicPortRange = $false

$global:RebootNeeded = $false

$global:IsSkipCleanupNetwork = [System.Convert]::ToBoolean("false");

# Extract cse helper script from ZIP
[io.file]::WriteAllBytes("scripts.zip", [System.Convert]::FromBase64String($zippedFiles))
Expand-Archive scripts.zip -DestinationPath "C:\\AzureData\\" -Force
Expand All @@ -235,7 +237,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.41.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.42.zip"
Write-Log "CSEScriptsPackageUrl is $global:CSEScriptsPackageUrl"
Write-Log "WindowsCSEScriptsPackage is $WindowsCSEScriptsPackage"
# Old AKS RP sets the full URL (https://acs-mirror.azureedge.net/aks/windows/cse/aks-windows-cse-scripts-v0.0.11.zip) in CSEScriptsPackageUrl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ $global:EnableIncreaseDynamicPortRange = $false

$global:RebootNeeded = $false

$global:IsSkipCleanupNetwork = [System.Convert]::ToBoolean("false");

# Extract cse helper script from ZIP
[io.file]::WriteAllBytes("scripts.zip", [System.Convert]::FromBase64String($zippedFiles))
Expand-Archive scripts.zip -DestinationPath "C:\\AzureData\\" -Force
Expand All @@ -235,7 +237,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.41.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.42.zip"
Write-Log "CSEScriptsPackageUrl is $global:CSEScriptsPackageUrl"
Write-Log "WindowsCSEScriptsPackage is $WindowsCSEScriptsPackage"
# Old AKS RP sets the full URL (https://acs-mirror.azureedge.net/aks/windows/cse/aks-windows-cse-scripts-v0.0.11.zip) in CSEScriptsPackageUrl
Expand Down
1 change: 1 addition & 0 deletions pkg/agent/variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func getWindowsCustomDataVariables(config *datamodel.NodeBootstrappingConfigurat
"windowsGpuDriverURL": cs.Properties.WindowsProfile.GpuDriverURL,
"windowsCSEScriptsPackageURL": cs.Properties.WindowsProfile.CseScriptsPackageURL,
"isDisableWindowsOutboundNat": strconv.FormatBool(config.AgentPoolProfile.IsDisableWindowsOutboundNat()),
"isSkipCleanupNetwork": strconv.FormatBool(config.AgentPoolProfile.IsSkipCleanupNetwork()),
}

return customData
Expand Down
4 changes: 3 additions & 1 deletion pkg/templates/templates_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions staging/cse/windows/README
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
1. Run below commands to build a test package
```bash
branchName="master"
currentCseVersion="v0.0.40" # `WindowsCSEScriptsPackage` defined in `parts/windows/kuberneteswindowssetup.ps1`
testCseVersion="v0.0.40.0" # Test package name. NOTE: Please do not use the official package format and earlier used version.
currentCseVersion="v0.0.42" # `WindowsCSEScriptsPackage` defined in `parts/windows/kuberneteswindowssetup.ps1`
testCseVersion="v0.0.42.0" # Test package name. NOTE: Please do not use the official package format and earlier used version.
url="https://raw.githubusercontent.com/Azure/AgentBaker/$branchName/staging/cse/windows"

mkdir -p temp-work-folder/aks-windows-cse
Expand Down Expand Up @@ -55,6 +55,11 @@ popd
# AKS Windows CSE Scripts Package
All files except *.test.ps1 and README will be published in AKS Windows CSE Scripts Package.

## v0.0.42
- feat: add parameters for collect-windows-logs.ps1 #4325
- feat: support skipping legacy code CleanupNetwork in AKS Windows CSE #4131
- chore: sync the latest Windows debug scripts #4279

## v0.0.41
- feat: update window cse to install credental provider #4281
- Add more containerd logs to collect-windows-logs.ps1 #3952
Expand Down
3 changes: 2 additions & 1 deletion vhdbuilder/packer/generate-windows-vhd-configuration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ $global:map = @{
"c:\akse-cache\" = @(
"https://acs-mirror.azureedge.net/ccgakvplugin/v1.1.5/binaries/windows-gmsa-ccgakvplugin-v1.1.5.zip",
"https://acs-mirror.azureedge.net/aks/windows/cse/aks-windows-cse-scripts-v0.0.40.zip",
"https://acs-mirror.azureedge.net/aks/windows/cse/aks-windows-cse-scripts-v0.0.41.zip"
"https://acs-mirror.azureedge.net/aks/windows/cse/aks-windows-cse-scripts-v0.0.41.zip",
"https://acs-mirror.azureedge.net/aks/windows/cse/aks-windows-cse-scripts-v0.0.42.zip"
);
# Different from other packages which are downloaded/cached and used later only during CSE, windows containerd is installed
# during building the Windows VHD to cache container images.
Expand Down

0 comments on commit e596bb9

Please sign in to comment.