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 committed Apr 10, 2024
1 parent 793fff1 commit bd6abd3
Show file tree
Hide file tree
Showing 18 changed files with 54 additions and 15 deletions.
4 changes: 3 additions & 1 deletion parts/windows/kuberneteswindowssetup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,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 @@ -236,7 +238,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip" # TODO: 41
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 @@ -1132,6 +1132,12 @@ func (a *AgentPoolProfile) IsVirtualMachineScaleSets() bool {
return strings.EqualFold(a.AvailabilityProfile, VirtualMachineScaleSets)
}

// 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
}

// IsAvailabilitySets returns true if the customer specified disks.
func (a *AgentPoolProfile) IsAvailabilitySets() bool {
return strings.EqualFold(a.AvailabilityProfile, AvailabilitySet)
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 @@ -208,6 +208,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 @@ -232,7 +234,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip" # TODO: 41
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 @@ -208,6 +208,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 @@ -232,7 +234,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip" # TODO: 41
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 @@ -208,6 +208,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 @@ -232,7 +234,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip" # TODO: 41
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 @@ -208,6 +208,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 @@ -232,7 +234,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip" # TODO: 41
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 @@ -208,6 +208,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 @@ -232,7 +234,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip" # TODO: 41
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 @@ -208,6 +208,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 @@ -232,7 +234,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip" # TODO: 41
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 @@ -208,6 +208,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 @@ -232,7 +234,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip" # TODO: 41
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 @@ -208,6 +208,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 @@ -232,7 +234,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip" # TODO: 41
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 @@ -208,6 +208,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 @@ -232,7 +234,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip" # TODO: 41
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 @@ -208,6 +208,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 @@ -232,7 +234,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip" # TODO: 41
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 @@ -208,6 +208,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 @@ -232,7 +234,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip" # TODO: 41
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 @@ -208,6 +208,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 @@ -232,7 +234,7 @@ try
Write-Log "private egress proxy address is '$global:PrivateEgressProxyAddress'"
# TODO update to use proxy

$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip"
$WindowsCSEScriptsPackage = "aks-windows-cse-scripts-v0.0.40.zip" # TODO: 41
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 @@ -110,6 +110,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.

4 changes: 4 additions & 0 deletions staging/cse/windows/README
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
1. Run below commands to build a test package
```bash
branchName="master"
# TODO: 41
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.
url="https://raw.githubusercontent.com/Azure/AgentBaker/$branchName/staging/cse/windows"
Expand Down Expand Up @@ -55,6 +56,9 @@ popd
# AKS Windows CSE Scripts Package
All files except *.test.ps1 and README will be published in AKS Windows CSE Scripts Package.

## v0.0.41
- feat: support skipping legacy code CleanupHnsNetwork in AKS Windows CSE #4131

## v0.0.40
- feat: set --node-ip for Windows kubelet in k8s v1.29+ #4148

Expand Down
2 changes: 1 addition & 1 deletion vhdbuilder/packer/generate-windows-vhd-configuration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ $global:map = @{
"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.37.zip",
"https://acs-mirror.azureedge.net/aks/windows/cse/aks-windows-cse-scripts-v0.0.39.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.40.zip" # TODO: 41
);
# 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 bd6abd3

Please sign in to comment.